Documentation ¶
Index ¶
- type Client
- func (cl *Client) CreateSecret(project, id string) error
- func (cl *Client) DeleteSecretLabel(project, id, key string) error
- func (cl *Client) DestroySecretVersion(project, id, version string) error
- func (cl *Client) DisableSecretVersion(project, id, version string) error
- func (cl *Client) EnableSecretVersion(project, id, version string) error
- func (cl *Client) GetCreateTime(project, id, version string) (time.Time, error)
- func (cl *Client) GetSecretLabels(project, id string) (map[string]string, error)
- func (cl *Client) GetSecretVersionData(project, id, version string) ([]byte, error)
- func (cl *Client) GetSecretVersionState(project, id, version string) (secretmanagerpb.SecretVersion_State, error)
- func (cl *Client) UpsertSecret(project, id string, data []byte) (string, error)
- func (cl *Client) UpsertSecretLabel(project, id, key, val string) error
- func (cl *Client) ValidateSecret(project, id string) error
- func (cl *Client) ValidateSecretVersion(project, id, version string) error
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*secretmanager.Client
}
func (*Client) CreateSecret ¶
CreateSecret creates an empty secret specified by project, id. It returns nil if successful, otherwise error.
func (*Client) DeleteSecretLabel ¶
DeleteSecretLabel deletes the key-value pair in labels of the secret specified by project, id, key. Returns error if update fails or the secret doesn't exist.
func (*Client) DestroySecretVersion ¶
DestroySecretVersion changes the state of secret version to DESTROYED returns nil if successful, otherwise error.
func (*Client) DisableSecretVersion ¶
DisableSecretVersion changes the state of secret version to DISABLED returns nil if successful, otherwise error.
func (*Client) EnableSecretVersion ¶
EnableSecretVersion changes the state of secret version to ENABLED returns nil if successful, otherwise error.
func (*Client) GetCreateTime ¶
GetCreateTime gets the createTime of the secret version specified by project, id, version. Returns createTime if successful, otherwise error.
func (*Client) GetSecretLabels ¶
GetSecretLabels gets the labels of the secret specified by project, id. Returns secret labels if successful, otherwise error
func (*Client) GetSecretVersionData ¶
GetSecretVersionData gets the data of the secret version specified by project, id, version. Returns secret value if successful, otherwise error
func (*Client) GetSecretVersionState ¶
func (cl *Client) GetSecretVersionState(project, id, version string) (secretmanagerpb.SecretVersion_State, error)
GetSecretVersionState gets the state of the secret version specified by project, id, version. Returns state if successful, otherwise error.
func (*Client) UpsertSecret ¶
UpsertSecret adds a new version to the secret specified by project, id. It inserts a new secret if id doesn't already exist. If successful the latest version will have 'data' as its secret value, and returns the latest version number if successful, otherwise returns error
func (*Client) UpsertSecretLabel ¶
UpsertSecretLabel updates or inserts the key-value pair in labels of the secret specified by project, id, key. Returns error if update fails or the secret doesn't exist.
func (*Client) ValidateSecret ¶
ValidateSecret returns nil if the secret exists, otherwise error.
func (*Client) ValidateSecretVersion ¶
ValidateSecretVersion returns nil if the secret version exists, otherwise error.
type Interface ¶
type Interface interface { ValidateSecret(project, id string) error ValidateSecretVersion(project, id, version string) error CreateSecret(project, id string) error UpsertSecret(project, id string, data []byte) (string, error) GetCreateTime(project, id, version string) (time.Time, error) GetSecretLabels(project, id string) (map[string]string, error) GetSecretVersionData(project, id, version string) ([]byte, error) GetSecretVersionState(project, id, version string) (secretmanagerpb.SecretVersion_State, error) EnableSecretVersion(project, id, version string) error DisableSecretVersion(project, id, version string) error DestroySecretVersion(project, id, version string) error UpsertSecretLabel(project, id, key, val string) error DeleteSecretLabel(project, id, key string) error }