Skip to content

Commit

Permalink
chore(server): fix const ops
Browse files Browse the repository at this point in the history
  • Loading branch information
irenarindos committed Oct 21, 2024
1 parent 50db63b commit 0065898
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/server/repository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (r *Repository) listControllersWithReader(ctx context.Context, reader db.Re
}

func (r *Repository) UpsertController(ctx context.Context, controller *store.Controller) (int, error) {
const op = "server.UpsertController"
const op = "server.(Repository).UpsertController"

if controller == nil {
return db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "controller is nil")
Expand Down
2 changes: 1 addition & 1 deletion internal/server/repository_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (

// AddNonce adds a nonce
func (r *Repository) AddNonce(ctx context.Context, nonce, purpose string, opt ...Option) error {
const op = "server.AddNonce"
const op = "server.(Repository).AddNonce"
if nonce == "" {
return errors.New(ctx, errors.InvalidParameter, op, "empty nonce")
}
Expand Down
6 changes: 3 additions & 3 deletions internal/server/repository_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func ListWorkers(ctx context.Context, reader db.Reader, scopeIds []string, opt .
// the only ones used. All others are ignored.
// Workers are intentionally not oplogged.
func (r *Repository) UpsertWorkerStatus(ctx context.Context, worker *Worker, opt ...Option) (*Worker, error) {
const op = "server.UpsertWorkerStatus"
const op = "server.(Repository).UpsertWorkerStatus"

opts := GetOpts(opt...)
switch {
Expand Down Expand Up @@ -485,10 +485,10 @@ func setWorkerTags(ctx context.Context, w db.Writer, id string, ts TagSource, ta
// via the old registration method or pki-kms) name updates will be disallowed.
func (r *Repository) UpdateWorker(ctx context.Context, worker *Worker, version uint32, fieldMaskPaths []string, opt ...Option) (*Worker, int, error) {
const (
op = "server.(Repository).UpdateWorker"
nameField = "name"
descField = "description"
)
const op = "server.(Repository).UpdateWorker"
switch {
case worker == nil:
return nil, db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "worker is nil")
Expand Down Expand Up @@ -597,7 +597,7 @@ func (r *Repository) UpdateWorker(ctx context.Context, worker *Worker, version u
// WithCreateControllerLedActivationToken. The latter two are mutually
// exclusive.
func (r *Repository) CreateWorker(ctx context.Context, worker *Worker, opt ...Option) (*Worker, error) {
const op = "server.CreateWorker"
const op = "server.(Repository).CreateWorker"

opts := GetOpts(opt...)

Expand Down
2 changes: 1 addition & 1 deletion internal/server/worker_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (w *WorkerCertBundle) clone() *WorkerCertBundle {

// Validate is called before storing a WorkerCertBundle in the db
func (w *WorkerCertBundle) ValidateNewWorkerCertBundle(ctx context.Context) error {
const op = "server.(WorkerAuth).validateNewWorkerCertBundle"
const op = "server.(WorkerCertBundle).validateNewWorkerCertBundle"
if w.RootCertificatePublicKey == nil {
return errors.New(ctx, errors.InvalidParameter, op, "missing CertificatePublicKey")
}
Expand Down

0 comments on commit 0065898

Please sign in to comment.