Documentation ¶
Index ¶
- Constants
- type Client
- type ClientImpl
- func (c *ClientImpl) Close() error
- func (c *ClientImpl) Create(ctx context.Context, project, name string) error
- func (c *ClientImpl) Get(ctx context.Context, project, secret, version string) (string, error)
- func (c *ClientImpl) GrantAccess(ctx context.Context, project, name, serviceAccount string) error
- func (c *ClientImpl) RevokeAccess(ctx context.Context, project, name, serviceAccount string) error
- func (c *ClientImpl) Update(ctx context.Context, project, name, value string) (string, error)
Constants ¶
View Source
const ( // VersionLatest can be provided to Get() in order to retrieve the most recent // version of a secret. VersionLatest = "latest" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Get the value of the given secret at the given version. Use "latest" to // retrieve the most recent version. Get(ctx context.Context, project, secret, version string) (string, error) // Update the given secret with a new version. Returns the resulting version. Update(ctx context.Context, project, name, value string) (string, error) // Create a new secret in the given project with the given name. Create(ctx context.Context, project, name string) error // GrantAccess grants the given service account access to the given secret. GrantAccess(ctx context.Context, project, name, serviceAccount string) error // RevokeAccess revokes the given service account's access to the given // secret. RevokeAccess(ctx context.Context, project, name, serviceAccount string) error // Close cleans up resources used by the Client. Close() error }
Client provides functionality for working with GCP Secrets.
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
ClientImpl implements Client.
func NewClient ¶
func NewClient(ctx context.Context) (*ClientImpl, error)
NewClient returns a Client instance.
func (*ClientImpl) Close ¶
func (c *ClientImpl) Close() error
Close implements the Client interface.
func (*ClientImpl) Create ¶
func (c *ClientImpl) Create(ctx context.Context, project, name string) error
Create implements the Client interface.
func (*ClientImpl) GrantAccess ¶
func (c *ClientImpl) GrantAccess(ctx context.Context, project, name, serviceAccount string) error
GrantAccess implements the Client interface.
func (*ClientImpl) RevokeAccess ¶
func (c *ClientImpl) RevokeAccess(ctx context.Context, project, name, serviceAccount string) error
RevokeAccess implements the Client interface.
Click to show internal directories.
Click to hide internal directories.