- 0.117.0 (latest)
- 0.116.0
- 0.115.1
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
Package binaryauthorization is an auto-generated package for the Binary Authorization API.
The management interface for Binary Authorization, a system providing policy control for images deployed to Kubernetes Engine clusters.
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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
AttestorIterator
type AttestorIterator 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 []*binaryauthorizationpb.Attestor, nextPageToken string, err error)
// contains filtered or unexported fields
}
AttestorIterator manages a stream of *binaryauthorizationpb.Attestor.
func (*AttestorIterator) Next
func (it *AttestorIterator) Next() (*binaryauthorizationpb.Attestor, 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 (*AttestorIterator) PageInfo
func (it *AttestorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
BinauthzManagementServiceV1Beta1CallOptions
type BinauthzManagementServiceV1Beta1CallOptions struct {
GetPolicy []gax.CallOption
UpdatePolicy []gax.CallOption
CreateAttestor []gax.CallOption
GetAttestor []gax.CallOption
UpdateAttestor []gax.CallOption
ListAttestors []gax.CallOption
DeleteAttestor []gax.CallOption
}
BinauthzManagementServiceV1Beta1CallOptions contains the retry settings for each method of BinauthzManagementServiceV1Beta1Client.
BinauthzManagementServiceV1Beta1Client
type BinauthzManagementServiceV1Beta1Client struct {
// The call options for this service.
CallOptions *BinauthzManagementServiceV1Beta1CallOptions
// contains filtered or unexported fields
}
BinauthzManagementServiceV1Beta1Client is a client for interacting with Binary Authorization API.
Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
func NewBinauthzManagementServiceV1Beta1Client
func NewBinauthzManagementServiceV1Beta1Client(ctx context.Context, opts ...option.ClientOption) (*BinauthzManagementServiceV1Beta1Client, error)
NewBinauthzManagementServiceV1Beta1Client creates a new binauthz management service v1 beta1 client.
Google Cloud Management Service for Binary Authorization admission policies and attestation authorities.
This API implements a REST model with the following objects:
Policy
Attestor
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
)
func main() {
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use client.
_ = c
}
func (*BinauthzManagementServiceV1Beta1Client) Close
func (c *BinauthzManagementServiceV1Beta1Client) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*BinauthzManagementServiceV1Beta1Client) Connection
func (c *BinauthzManagementServiceV1Beta1Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*BinauthzManagementServiceV1Beta1Client) CreateAttestor
func (c *BinauthzManagementServiceV1Beta1Client) CreateAttestor(ctx context.Context, req *binaryauthorizationpb.CreateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error)
CreateAttestor creates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the attestor already exists.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
// import binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.CreateAttestorRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateAttestor(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BinauthzManagementServiceV1Beta1Client) DeleteAttestor
func (c *BinauthzManagementServiceV1Beta1Client) DeleteAttestor(ctx context.Context, req *binaryauthorizationpb.DeleteAttestorRequest, opts ...gax.CallOption) error
DeleteAttestor deletes an attestor. Returns NOT_FOUND if the attestor does not exist.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.DeleteAttestorRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteAttestor(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*BinauthzManagementServiceV1Beta1Client) GetAttestor
func (c *BinauthzManagementServiceV1Beta1Client) GetAttestor(ctx context.Context, req *binaryauthorizationpb.GetAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error)
GetAttestor gets an attestor. Returns NOT_FOUND if the attestor does not exist.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
// import binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.GetAttestorRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetAttestor(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BinauthzManagementServiceV1Beta1Client) GetPolicy
func (c *BinauthzManagementServiceV1Beta1Client) GetPolicy(ctx context.Context, req *binaryauthorizationpb.GetPolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error)
GetPolicy a policy specifies the attestors that must attest to a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy.
Gets the policy for this project. Returns a default policy if the project does not have one.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
// import binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.GetPolicyRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BinauthzManagementServiceV1Beta1Client) ListAttestors
func (c *BinauthzManagementServiceV1Beta1Client) ListAttestors(ctx context.Context, req *binaryauthorizationpb.ListAttestorsRequest, opts ...gax.CallOption) *AttestorIterator
ListAttestors lists attestors. Returns INVALID_ARGUMENT if the project does not exist.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
"google.golang.org/api/iterator"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
// import binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
// import "google.golang.org/api/iterator"
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.ListAttestorsRequest{
// TODO: Fill request struct fields.
}
it := c.ListAttestors(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BinauthzManagementServiceV1Beta1Client) UpdateAttestor
func (c *BinauthzManagementServiceV1Beta1Client) UpdateAttestor(ctx context.Context, req *binaryauthorizationpb.UpdateAttestorRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Attestor, error)
UpdateAttestor updates an attestor. Returns NOT_FOUND if the attestor does not exist.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
// import binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.UpdateAttestorRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateAttestor(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BinauthzManagementServiceV1Beta1Client) UpdatePolicy
func (c *BinauthzManagementServiceV1Beta1Client) UpdatePolicy(ctx context.Context, req *binaryauthorizationpb.UpdatePolicyRequest, opts ...gax.CallOption) (*binaryauthorizationpb.Policy, error)
UpdatePolicy creates or updates a project’s policy, and returns a copy of the new policy. A policy is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed.
Example
package main
import (
"context"
binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1beta1"
binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
)
func main() {
// import binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1"
ctx := context.Background()
c, err := binaryauthorization.NewBinauthzManagementServiceV1Beta1Client(ctx)
if err != nil {
// TODO: Handle error.
}
req := &binaryauthorizationpb.UpdatePolicyRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdatePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}