Involved Source Files
Package secretmanager is an auto-generated package for the
Secret Manager API.
Stores sensitive data such as API keys, passwords, and certificates.
Provides convenience while improving security.
Use of Context
The ctx passed to NewClient is used for authentication requests and
for creating the underlying connection, but is not used for subsequent calls.
Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more
please visit pkg.go.dev/cloud.google.com/go.
iam.gosecret_manager_client.go
Package-Level Type Names (total 6, in which 4 are exported)
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.
The call options for this service.
The gRPC API client.
Connection pool of gRPC connections to the service.
flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
The x-goog-* metadata to be sent with each request.
AccessSecretVersion accesses a SecretVersion. This call returns the secret data.
projects/*/secrets/*/versions/latest is an alias to the latest
SecretVersion.
AddSecretVersion creates a new SecretVersion containing secret data and attaches
it to an existing Secret.
Close closes the connection to the API service. The user should invoke this when
the client is no longer required.
Connection returns a connection to the API service.
Deprecated.
CreateSecret creates a new Secret containing no SecretVersions.
DeleteSecret deletes a Secret.
DestroySecretVersion destroys a SecretVersion.
Sets the state of the SecretVersion to
DESTROYED and irrevocably destroys the
secret data.
DisableSecretVersion disables a SecretVersion.
Sets the state of the SecretVersion to
DISABLED.
EnableSecretVersion enables a SecretVersion.
Sets the state of the SecretVersion to
ENABLED.
GetIamPolicy gets the access control policy for a secret.
Returns empty policy if the secret exists and does not have a policy set.
GetSecret gets metadata for a given Secret.
GetSecretVersion gets metadata for a SecretVersion.
projects/*/secrets/*/versions/latest is an alias to the latest
SecretVersion.
IAM returns a handle to inspect and change permissions of the resource
indicated by the given resource path. Name should be of the format
`projects/my-project/secrets/my-secret`.
ListSecretVersions lists SecretVersions. This call does not return secret
data.
ListSecrets lists Secrets.
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.
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.
UpdateSecret updates metadata of an existing Secret.
setGoogleClientInfo sets the name and version of the application in
the `x-goog-api-client` header passed on each request. Intended for
use by Google-written clients.
*T : io.Closer
func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)
SecretIterator manages a stream of *secretmanagerpb.Secret.
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.
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.
items[]*secretmanagerpb.SecretnextFuncfunc() errorpageInfo*iterator.PageInfo
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.
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
(*T) bufLen() int(*T) takeBuf() interface{}
*T : google.golang.org/api/iterator.Pageable
func (*Client).ListSecrets(ctx context.Context, req *secretmanagerpb.ListSecretsRequest, opts ...gax.CallOption) *SecretIterator
SecretVersionIterator manages a stream of *secretmanagerpb.SecretVersion.
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.
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.
items[]*secretmanagerpb.SecretVersionnextFuncfunc() errorpageInfo*iterator.PageInfo
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.
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
(*T) bufLen() int(*T) takeBuf() interface{}
*T : google.golang.org/api/iterator.Pageable
func (*Client).ListSecretVersions(ctx context.Context, req *secretmanagerpb.ListSecretVersionsRequest, opts ...gax.CallOption) *SecretVersionIterator
For more information on implementing a client constructor hook, see
https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors.
Package-Level Functions (total 7, in which 2 are exported)
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
NewClient creates a new secret manager service client.
Secret Manager Service
Manages secrets and operations using those secrets. Implements a REST
model with the following objects:
Secret
SecretVersion
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.