func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CallOptions contains the retry settings for each method of Client.
type CallOptions struct { ListSecrets []gax.CallOption CreateSecret []gax.CallOption AddSecretVersion []gax.CallOption GetSecret []gax.CallOption UpdateSecret []gax.CallOption DeleteSecret []gax.CallOption ListSecretVersions []gax.CallOption GetSecretVersion []gax.CallOption AccessSecretVersion []gax.CallOption DisableSecretVersion []gax.CallOption EnableSecretVersion []gax.CallOption DestroySecretVersion []gax.CallOption SetIamPolicy []gax.CallOption GetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption }
Client is a client for interacting with Secret Manager API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages secrets and operations using those secrets. Implements a REST model with the following objects:
Secret SecretVersion
type Client struct { // The call options for this service. CallOptions *CallOptions // contains filtered or unexported fields }
func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
NewClient creates a new secret manager service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages secrets and operations using those secrets. Implements a REST model with the following objects:
Secret SecretVersion
▹ Example
func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
NewRESTClient creates a new secret manager service rest client.
Manages secrets and operations using those secrets. Implements a REST model with the following objects:
Secret SecretVersion
▹ Example
func (c *Client) AccessSecretVersion(ctx context.Context, req *secretmanagerpb.AccessSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.AccessSecretVersionResponse, error)
AccessSecretVersion accesses a SecretVersion. This call returns the secret data.
projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.
▹ Example
func (c *Client) AddSecretVersion(ctx context.Context, req *secretmanagerpb.AddSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)
AddSecretVersion creates a new SecretVersion containing secret data and attaches it to an existing Secret.
▹ Example
func (c *Client) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (c *Client) CreateSecret(ctx context.Context, req *secretmanagerpb.CreateSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, error)
CreateSecret creates a new Secret containing no SecretVersions.
▹ Example
func (c *Client) DeleteSecret(ctx context.Context, req *secretmanagerpb.DeleteSecretRequest, opts ...gax.CallOption) error
DeleteSecret deletes a Secret.
▹ Example
func (c *Client) DestroySecretVersion(ctx context.Context, req *secretmanagerpb.DestroySecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)
DestroySecretVersion destroys a SecretVersion.
Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data.
▹ Example
func (c *Client) DisableSecretVersion(ctx context.Context, req *secretmanagerpb.DisableSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)
DisableSecretVersion disables a SecretVersion.
Sets the state of the SecretVersion to DISABLED.
▹ Example
func (c *Client) EnableSecretVersion(ctx context.Context, req *secretmanagerpb.EnableSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)
EnableSecretVersion enables a SecretVersion.
Sets the state of the SecretVersion to ENABLED.
▹ Example
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.
▹ Example
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
▹ Example
func (c *Client) GetSecret(ctx context.Context, req *secretmanagerpb.GetSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, error)
GetSecret gets metadata for a given Secret.
▹ Example
func (c *Client) GetSecretVersion(ctx context.Context, req *secretmanagerpb.GetSecretVersionRequest, opts ...gax.CallOption) (*secretmanagerpb.SecretVersion, error)
GetSecretVersion gets metadata for a SecretVersion.
projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.
▹ Example
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
▹ Example
func (c *Client) ListSecretVersions(ctx context.Context, req *secretmanagerpb.ListSecretVersionsRequest, opts ...gax.CallOption) *SecretVersionIterator
ListSecretVersions lists SecretVersions. This call does not return secret data.
▹ Example
func (c *Client) ListSecrets(ctx context.Context, req *secretmanagerpb.ListSecretsRequest, opts ...gax.CallOption) *SecretIterator
ListSecrets lists Secrets.
▹ Example
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified secret. Replaces any existing policy.
Permissions on SecretVersions are enforced according to the policy set on the associated Secret.
▹ Example
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
▹ Example
func (c *Client) UpdateSecret(ctx context.Context, req *secretmanagerpb.UpdateSecretRequest, opts ...gax.CallOption) (*secretmanagerpb.Secret, error)
UpdateSecret updates metadata of an existing Secret.
▹ Example
LocationIterator manages a stream of *locationpb.Location.
type LocationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
SecretIterator manages a stream of *secretmanagerpb.Secret.
type SecretIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*secretmanagerpb.Secret, nextPageToken string, err error) // contains filtered or unexported fields }
func (it *SecretIterator) Next() (*secretmanagerpb.Secret, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (it *SecretIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
SecretVersionIterator manages a stream of *secretmanagerpb.SecretVersion.
type SecretVersionIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*secretmanagerpb.SecretVersion, nextPageToken string, err error) // contains filtered or unexported fields }
func (it *SecretVersionIterator) Next() (*secretmanagerpb.SecretVersion, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (it *SecretVersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
Name | Synopsis |
---|---|
.. | |
secretmanagerpb |