Package schemaregistry is an auto-generated package for the Managed Service for Apache Kafka API.
Manage Apache Kafka clusters and resources.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/managedkafka/schemaregistry/apiv1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &schemaregistrypb.CheckCompatibilityRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CheckCompatibilityRequest. } resp, err := c.CheckCompatibility(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewManagedSchemaRegistryClient 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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
LocationIterator
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
}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next
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 (*LocationIterator) PageInfo
func (it *LocationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ManagedSchemaRegistryCallOptions
type ManagedSchemaRegistryCallOptions struct {
GetSchemaRegistry []gax.CallOption
ListSchemaRegistries []gax.CallOption
CreateSchemaRegistry []gax.CallOption
DeleteSchemaRegistry []gax.CallOption
GetContext []gax.CallOption
ListContexts []gax.CallOption
GetSchema []gax.CallOption
GetRawSchema []gax.CallOption
ListSchemaVersions []gax.CallOption
ListSchemaTypes []gax.CallOption
ListSubjects []gax.CallOption
ListSubjectsBySchemaId []gax.CallOption
DeleteSubject []gax.CallOption
LookupVersion []gax.CallOption
GetVersion []gax.CallOption
GetRawSchemaVersion []gax.CallOption
ListVersions []gax.CallOption
CreateVersion []gax.CallOption
DeleteVersion []gax.CallOption
ListReferencedSchemas []gax.CallOption
CheckCompatibility []gax.CallOption
GetSchemaConfig []gax.CallOption
UpdateSchemaConfig []gax.CallOption
DeleteSchemaConfig []gax.CallOption
GetSchemaMode []gax.CallOption
UpdateSchemaMode []gax.CallOption
DeleteSchemaMode []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ManagedSchemaRegistryCallOptions contains the retry settings for each method of ManagedSchemaRegistryClient.
ManagedSchemaRegistryClient
type ManagedSchemaRegistryClient struct {
// The call options for this service.
CallOptions *ManagedSchemaRegistryCallOptions
// contains filtered or unexported fields
}ManagedSchemaRegistryClient is a client for interacting with Managed Service for Apache Kafka API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:
SchemaRegistry
SchemaRegistry/Context
SchemaRegistry/Context/Schema
SchemaRegistry/Context/Subject
SchemaRegistry/Context/Subject/Version
SchemaRegistry/Config
SchemaRegistry/Mode
SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.
Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a ‘default’ context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the ‘default’ context.
Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.
Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.
Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.
Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.
Mode represents the mode of a schema registry or a specific subject. Three modes are supported:
READONLY: The schema registry is in read-only mode, no write operations
allowed…
READWRITE: The schema registry is in read-write mode, which allows limited
write operations on the schema.
IMPORT: The schema registry is in import mode, which allows more editing
operations on the schema for data importing purposes.
func NewManagedSchemaRegistryClient
func NewManagedSchemaRegistryClient(ctx context.Context, opts ...option.ClientOption) (*ManagedSchemaRegistryClient, error)NewManagedSchemaRegistryClient creates a new managed schema registry client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:
SchemaRegistry
SchemaRegistry/Context
SchemaRegistry/Context/Schema
SchemaRegistry/Context/Subject
SchemaRegistry/Context/Subject/Version
SchemaRegistry/Config
SchemaRegistry/Mode
SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.
Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a ‘default’ context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the ‘default’ context.
Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.
Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.
Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.
Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.
Mode represents the mode of a schema registry or a specific subject. Three modes are supported:
READONLY: The schema registry is in read-only mode, no write operations
allowed…
READWRITE: The schema registry is in read-write mode, which allows limited
write operations on the schema.
IMPORT: The schema registry is in import mode, which allows more editing
operations on the schema for data importing purposes.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewManagedSchemaRegistryRESTClient
func NewManagedSchemaRegistryRESTClient(ctx context.Context, opts ...option.ClientOption) (*ManagedSchemaRegistryClient, error)NewManagedSchemaRegistryRESTClient creates a new managed schema registry rest client.
SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:
SchemaRegistry
SchemaRegistry/Context
SchemaRegistry/Context/Schema
SchemaRegistry/Context/Subject
SchemaRegistry/Context/Subject/Version
SchemaRegistry/Config
SchemaRegistry/Mode
SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.
Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a ‘default’ context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the ‘default’ context.
Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.
Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.
Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.
Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.
Mode represents the mode of a schema registry or a specific subject. Three modes are supported:
READONLY: The schema registry is in read-only mode, no write operations
allowed…
READWRITE: The schema registry is in read-write mode, which allows limited
write operations on the schema.
IMPORT: The schema registry is in import mode, which allows more editing
operations on the schema for data importing purposes.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ManagedSchemaRegistryClient) CancelOperation
func (c *ManagedSchemaRegistryClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ManagedSchemaRegistryClient) CheckCompatibility
func (c *ManagedSchemaRegistryClient) CheckCompatibility(ctx context.Context, req *schemaregistrypb.CheckCompatibilityRequest, opts ...gax.CallOption) (*schemaregistrypb.CheckCompatibilityResponse, error)CheckCompatibility check compatibility of a schema with all versions or a specific version of a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.CheckCompatibilityRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CheckCompatibilityRequest.
}
resp, err := c.CheckCompatibility(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) Close
func (c *ManagedSchemaRegistryClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ManagedSchemaRegistryClient) Connection (deprecated)
func (c *ManagedSchemaRegistryClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ManagedSchemaRegistryClient) CreateSchemaRegistry
func (c *ManagedSchemaRegistryClient) CreateSchemaRegistry(ctx context.Context, req *schemaregistrypb.CreateSchemaRegistryRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaRegistry, error)CreateSchemaRegistry create a schema registry instance.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.CreateSchemaRegistryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CreateSchemaRegistryRequest.
}
resp, err := c.CreateSchemaRegistry(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) CreateVersion
func (c *ManagedSchemaRegistryClient) CreateVersion(ctx context.Context, req *schemaregistrypb.CreateVersionRequest, opts ...gax.CallOption) (*schemaregistrypb.CreateVersionResponse, error)CreateVersion register a new version under a given subject with the given schema.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.CreateVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CreateVersionRequest.
}
resp, err := c.CreateVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) DeleteOperation
func (c *ManagedSchemaRegistryClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ManagedSchemaRegistryClient) DeleteSchemaConfig
func (c *ManagedSchemaRegistryClient) DeleteSchemaConfig(ctx context.Context, req *schemaregistrypb.DeleteSchemaConfigRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaConfig, error)DeleteSchemaConfig delete schema config for a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.DeleteSchemaConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaConfigRequest.
}
resp, err := c.DeleteSchemaConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) DeleteSchemaMode
func (c *ManagedSchemaRegistryClient) DeleteSchemaMode(ctx context.Context, req *schemaregistrypb.DeleteSchemaModeRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaMode, error)DeleteSchemaMode delete schema mode for a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.DeleteSchemaModeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaModeRequest.
}
resp, err := c.DeleteSchemaMode(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) DeleteSchemaRegistry
func (c *ManagedSchemaRegistryClient) DeleteSchemaRegistry(ctx context.Context, req *schemaregistrypb.DeleteSchemaRegistryRequest, opts ...gax.CallOption) errorDeleteSchemaRegistry delete a schema registry instance.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.DeleteSchemaRegistryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaRegistryRequest.
}
err = c.DeleteSchemaRegistry(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ManagedSchemaRegistryClient) DeleteSubject
func (c *ManagedSchemaRegistryClient) DeleteSubject(ctx context.Context, req *schemaregistrypb.DeleteSubjectRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)DeleteSubject delete a subject. The response will be an array of versions of the deleted subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.DeleteSubjectRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSubjectRequest.
}
resp, err := c.DeleteSubject(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) DeleteVersion
func (c *ManagedSchemaRegistryClient) DeleteVersion(ctx context.Context, req *schemaregistrypb.DeleteVersionRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)DeleteVersion delete a version of a subject. The response will be the deleted version id.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.DeleteVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteVersionRequest.
}
resp, err := c.DeleteVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetContext
func (c *ManagedSchemaRegistryClient) GetContext(ctx context.Context, req *schemaregistrypb.GetContextRequest, opts ...gax.CallOption) (*schemaregistrypb.Context, error)GetContext get the context.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetContextRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetContextRequest.
}
resp, err := c.GetContext(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetLocation
func (c *ManagedSchemaRegistryClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetOperation
func (c *ManagedSchemaRegistryClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetRawSchema
func (c *ManagedSchemaRegistryClient) GetRawSchema(ctx context.Context, req *schemaregistrypb.GetSchemaRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)GetRawSchema get the schema string for the given schema id. The response will be the schema string.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetSchemaRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRequest.
}
resp, err := c.GetRawSchema(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetRawSchemaVersion
func (c *ManagedSchemaRegistryClient) GetRawSchemaVersion(ctx context.Context, req *schemaregistrypb.GetVersionRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)GetRawSchemaVersion get the schema string only for a version of a subject. The response will be the schema string.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetVersionRequest.
}
resp, err := c.GetRawSchemaVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetSchema
func (c *ManagedSchemaRegistryClient) GetSchema(ctx context.Context, req *schemaregistrypb.GetSchemaRequest, opts ...gax.CallOption) (*schemaregistrypb.Schema, error)GetSchema get the schema for the given schema id.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetSchemaRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRequest.
}
resp, err := c.GetSchema(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetSchemaConfig
func (c *ManagedSchemaRegistryClient) GetSchemaConfig(ctx context.Context, req *schemaregistrypb.GetSchemaConfigRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaConfig, error)GetSchemaConfig get schema config at global level or for a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetSchemaConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaConfigRequest.
}
resp, err := c.GetSchemaConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetSchemaMode
func (c *ManagedSchemaRegistryClient) GetSchemaMode(ctx context.Context, req *schemaregistrypb.GetSchemaModeRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaMode, error)GetSchemaMode get mode at global level or for a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetSchemaModeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaModeRequest.
}
resp, err := c.GetSchemaMode(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetSchemaRegistry
func (c *ManagedSchemaRegistryClient) GetSchemaRegistry(ctx context.Context, req *schemaregistrypb.GetSchemaRegistryRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaRegistry, error)GetSchemaRegistry get the schema registry instance.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetSchemaRegistryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRegistryRequest.
}
resp, err := c.GetSchemaRegistry(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) GetVersion
func (c *ManagedSchemaRegistryClient) GetVersion(ctx context.Context, req *schemaregistrypb.GetVersionRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaVersion, error)GetVersion get a versioned schema (schema with subject/version) of a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.GetVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetVersionRequest.
}
resp, err := c.GetVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListContexts
func (c *ManagedSchemaRegistryClient) ListContexts(ctx context.Context, req *schemaregistrypb.ListContextsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListContexts list contexts for a schema registry.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListContextsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListContextsRequest.
}
resp, err := c.ListContexts(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListLocations
func (c *ManagedSchemaRegistryClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ManagedSchemaRegistryClient) ListOperations
func (c *ManagedSchemaRegistryClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ManagedSchemaRegistryClient) ListReferencedSchemas
func (c *ManagedSchemaRegistryClient) ListReferencedSchemas(ctx context.Context, req *schemaregistrypb.ListReferencedSchemasRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListReferencedSchemas get a list of IDs of schemas that reference the schema with the given subject and version.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListReferencedSchemasRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListReferencedSchemasRequest.
}
resp, err := c.ListReferencedSchemas(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListSchemaRegistries
func (c *ManagedSchemaRegistryClient) ListSchemaRegistries(ctx context.Context, req *schemaregistrypb.ListSchemaRegistriesRequest, opts ...gax.CallOption) (*schemaregistrypb.ListSchemaRegistriesResponse, error)ListSchemaRegistries list schema registries.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListSchemaRegistriesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaRegistriesRequest.
}
resp, err := c.ListSchemaRegistries(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListSchemaTypes
func (c *ManagedSchemaRegistryClient) ListSchemaTypes(ctx context.Context, req *schemaregistrypb.ListSchemaTypesRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListSchemaTypes list the supported schema types. The response will be an array of schema types.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListSchemaTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaTypesRequest.
}
resp, err := c.ListSchemaTypes(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListSchemaVersions
func (c *ManagedSchemaRegistryClient) ListSchemaVersions(ctx context.Context, req *schemaregistrypb.ListSchemaVersionsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListSchemaVersions list the schema versions for the given schema id. The response will be an array of subject-version pairs as: [{“subject”:“subject1”, “version”:1}, {“subject”:“subject2”, “version”:2}].
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListSchemaVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaVersionsRequest.
}
resp, err := c.ListSchemaVersions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListSubjects
func (c *ManagedSchemaRegistryClient) ListSubjects(ctx context.Context, req *schemaregistrypb.ListSubjectsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListSubjects list subjects in the schema registry. The response will be an array of subject names.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListSubjectsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSubjectsRequest.
}
resp, err := c.ListSubjects(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListSubjectsBySchemaId
func (c *ManagedSchemaRegistryClient) ListSubjectsBySchemaId(ctx context.Context, req *schemaregistrypb.ListSubjectsBySchemaIdRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListSubjectsBySchemaId list subjects which reference a particular schema id. The response will be an array of subject names.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListSubjectsBySchemaIdRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSubjectsBySchemaIdRequest.
}
resp, err := c.ListSubjectsBySchemaId(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) ListVersions
func (c *ManagedSchemaRegistryClient) ListVersions(ctx context.Context, req *schemaregistrypb.ListVersionsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)ListVersions get all versions of a subject. The response will be an array of versions of the subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.ListVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListVersionsRequest.
}
resp, err := c.ListVersions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) LookupVersion
func (c *ManagedSchemaRegistryClient) LookupVersion(ctx context.Context, req *schemaregistrypb.LookupVersionRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaVersion, error)LookupVersion lookup a schema under the specified subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.LookupVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#LookupVersionRequest.
}
resp, err := c.LookupVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) UpdateSchemaConfig
func (c *ManagedSchemaRegistryClient) UpdateSchemaConfig(ctx context.Context, req *schemaregistrypb.UpdateSchemaConfigRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaConfig, error)UpdateSchemaConfig update config at global level or for a subject. Creates a SchemaSubject-level SchemaConfig if it does not exist.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.UpdateSchemaConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#UpdateSchemaConfigRequest.
}
resp, err := c.UpdateSchemaConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ManagedSchemaRegistryClient) UpdateSchemaMode
func (c *ManagedSchemaRegistryClient) UpdateSchemaMode(ctx context.Context, req *schemaregistrypb.UpdateSchemaModeRequest, opts ...gax.CallOption) (*schemaregistrypb.SchemaMode, error)UpdateSchemaMode update mode at global level or for a subject.
Example
package main
import (
"context"
schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1"
schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := schemaregistry.NewManagedSchemaRegistryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &schemaregistrypb.UpdateSchemaModeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#UpdateSchemaModeRequest.
}
resp, err := c.UpdateSchemaMode(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
OperationIterator
type OperationIterator 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 []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*longrunningpb.Operation, 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 (*OperationIterator) PageInfo
func (it *OperationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.