Skip to content

Commit

Permalink
remove library references and remove stutter
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Mar 6, 2024
1 parent 167cb5e commit 082a404
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/types/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/go-vela/types/library"
)

// Worker is the library representation of a worker.
// Worker is the API representation of a worker.
//
// swagger:model Worker
type Worker struct {
Expand Down
2 changes: 1 addition & 1 deletion database/worker/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (e *engine) CreateWorker(ctx context.Context, w *api.Worker) (*api.Worker,
// cast the library type to database type
//
// https://pkg.go.dev/github.com/go-vela/types/database#WorkerFromLibrary
worker := WorkerFromAPI(w)
worker := FromAPI(w)

// validate the necessary fields are populated
//
Expand Down
2 changes: 1 addition & 1 deletion database/worker/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (e *engine) DeleteWorker(ctx context.Context, w *api.Worker) error {
// cast the library type to database type
//
// https://pkg.go.dev/github.com/go-vela/types/database#WorkerFromLibrary
worker := WorkerFromAPI(w)
worker := FromAPI(w)

// send query to the database
return e.client.
Expand Down
2 changes: 1 addition & 1 deletion database/worker/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (e *engine) UpdateWorker(ctx context.Context, w *api.Worker) (*api.Worker,
// cast the library type to database type
//
// https://pkg.go.dev/github.com/go-vela/types/database#WorkerFromLibrary
worker := WorkerFromAPI(w)
worker := FromAPI(w)

// validate the necessary fields are populated
//
Expand Down
4 changes: 2 additions & 2 deletions database/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ func (w *Worker) Validate() error {
return nil
}

// WorkerFromAPI converts the library worker type
// FromAPI converts the API worker type
// to a database worker type.
func WorkerFromAPI(w *api.Worker) *Worker {
func FromAPI(w *api.Worker) *Worker {
var rBs []string

for _, b := range w.GetRunningBuilds() {
Expand Down

0 comments on commit 082a404

Please sign in to comment.