github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/worker/uniter/operation/secrets.go (about)

     1  // Copyright 2018 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package operation
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"github.com/juju/errors"
    10  )
    11  
    12  type noOpSecretsRemoved struct {
    13  	Operation
    14  	uris      []string
    15  	callbacks Callbacks
    16  }
    17  
    18  // String is part of the Operation interface.
    19  func (op *noOpSecretsRemoved) String() string {
    20  	return fmt.Sprintf("process removed secrets: %v", op.uris)
    21  }
    22  
    23  // Commit is part of the Operation interface.
    24  func (op *noOpSecretsRemoved) Commit(state State) (*State, error) {
    25  	if err := op.callbacks.SecretsRemoved(op.uris); err != nil {
    26  		return nil, errors.Trace(err)
    27  	}
    28  	// make no change to state
    29  	return &state, nil
    30  }