UserSecretsManager
Defines an interface for managing user secrets with support for read and write operations.
type UserSecretsManager interface{}Properties
FilePath stringgetFilePath() (string, error)IsAvailable boolgetIsAvailable() (bool, error)Methods
GetOrSetSecret GetOrSetSecret( resourceBuilder Resource, name string, value string,) errorParameters
resourceBuilder ResourceA resource builder from the target application.namestringThe secret name.valuestringThe value to persist when the secret is missing.Returns
errorReturns error.
SaveStateJson SaveStateJson( json string, options ...*SaveStateJsonOptions,) errorParameters
jsonstringThe JSON object payload to persist.options...*SaveStateJsonOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*SaveStateJsonOptions argument.
CancellationToken *CancellationToken The cancellation token.Returns
errorA task that completes when the state is saved.
Returns error.
TryDeleteSecret TryDeleteSecret(name string) (bool, error)Parameters
namestringThe name of the secret.Returns
(bool, error) True if the secret was deleted successfully; otherwise, false.
Returns (bool, error).
TrySetSecret TrySetSecret( name string, value string,) (bool, error)Parameters
namestringThe name of the secret.valuestringThe value of the secret.Returns
(bool, error) True if the secret was set successfully; otherwise, false.
Returns (bool, error).
Applies to
This interface applies to the following types: