Documentation
¶
Overview ¶
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.
Index ¶
- func DefaultAuthScopes() []string
- type LocationIterator
- type ManagedSchemaRegistryCallOptions
- type ManagedSchemaRegistryClient
- func (c *ManagedSchemaRegistryClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ManagedSchemaRegistryClient) CheckCompatibility(ctx context.Context, req *schemaregistrypb.CheckCompatibilityRequest, ...) (*schemaregistrypb.CheckCompatibilityResponse, error)
- func (c *ManagedSchemaRegistryClient) Close() error
- func (c *ManagedSchemaRegistryClient) Connection() *grpc.ClientConndeprecated
- func (c *ManagedSchemaRegistryClient) CreateSchemaRegistry(ctx context.Context, req *schemaregistrypb.CreateSchemaRegistryRequest, ...) (*schemaregistrypb.SchemaRegistry, error)
- func (c *ManagedSchemaRegistryClient) CreateVersion(ctx context.Context, req *schemaregistrypb.CreateVersionRequest, ...) (*schemaregistrypb.CreateVersionResponse, error)
- func (c *ManagedSchemaRegistryClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ManagedSchemaRegistryClient) DeleteSchemaConfig(ctx context.Context, req *schemaregistrypb.DeleteSchemaConfigRequest, ...) (*schemaregistrypb.SchemaConfig, error)
- func (c *ManagedSchemaRegistryClient) DeleteSchemaMode(ctx context.Context, req *schemaregistrypb.DeleteSchemaModeRequest, ...) (*schemaregistrypb.SchemaMode, error)
- func (c *ManagedSchemaRegistryClient) DeleteSchemaRegistry(ctx context.Context, req *schemaregistrypb.DeleteSchemaRegistryRequest, ...) error
- func (c *ManagedSchemaRegistryClient) DeleteSubject(ctx context.Context, req *schemaregistrypb.DeleteSubjectRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) DeleteVersion(ctx context.Context, req *schemaregistrypb.DeleteVersionRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) GetContext(ctx context.Context, req *schemaregistrypb.GetContextRequest, ...) (*schemaregistrypb.Context, error)
- func (c *ManagedSchemaRegistryClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *ManagedSchemaRegistryClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ManagedSchemaRegistryClient) GetRawSchema(ctx context.Context, req *schemaregistrypb.GetSchemaRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) GetRawSchemaVersion(ctx context.Context, req *schemaregistrypb.GetVersionRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) GetSchema(ctx context.Context, req *schemaregistrypb.GetSchemaRequest, ...) (*schemaregistrypb.Schema, error)
- func (c *ManagedSchemaRegistryClient) GetSchemaConfig(ctx context.Context, req *schemaregistrypb.GetSchemaConfigRequest, ...) (*schemaregistrypb.SchemaConfig, error)
- func (c *ManagedSchemaRegistryClient) GetSchemaMode(ctx context.Context, req *schemaregistrypb.GetSchemaModeRequest, ...) (*schemaregistrypb.SchemaMode, error)
- func (c *ManagedSchemaRegistryClient) GetSchemaRegistry(ctx context.Context, req *schemaregistrypb.GetSchemaRegistryRequest, ...) (*schemaregistrypb.SchemaRegistry, error)
- func (c *ManagedSchemaRegistryClient) GetVersion(ctx context.Context, req *schemaregistrypb.GetVersionRequest, ...) (*schemaregistrypb.SchemaVersion, error)
- func (c *ManagedSchemaRegistryClient) ListContexts(ctx context.Context, req *schemaregistrypb.ListContextsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *ManagedSchemaRegistryClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *ManagedSchemaRegistryClient) ListReferencedSchemas(ctx context.Context, req *schemaregistrypb.ListReferencedSchemasRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) ListSchemaRegistries(ctx context.Context, req *schemaregistrypb.ListSchemaRegistriesRequest, ...) (*schemaregistrypb.ListSchemaRegistriesResponse, error)
- func (c *ManagedSchemaRegistryClient) ListSchemaTypes(ctx context.Context, req *schemaregistrypb.ListSchemaTypesRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) ListSchemaVersions(ctx context.Context, req *schemaregistrypb.ListSchemaVersionsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) ListSubjects(ctx context.Context, req *schemaregistrypb.ListSubjectsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) ListSubjectsBySchemaId(ctx context.Context, req *schemaregistrypb.ListSubjectsBySchemaIdRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) ListVersions(ctx context.Context, req *schemaregistrypb.ListVersionsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *ManagedSchemaRegistryClient) LookupVersion(ctx context.Context, req *schemaregistrypb.LookupVersionRequest, ...) (*schemaregistrypb.SchemaVersion, error)
- func (c *ManagedSchemaRegistryClient) UpdateSchemaConfig(ctx context.Context, req *schemaregistrypb.UpdateSchemaConfigRequest, ...) (*schemaregistrypb.SchemaConfig, error)
- func (c *ManagedSchemaRegistryClient) UpdateSchemaMode(ctx context.Context, req *schemaregistrypb.UpdateSchemaModeRequest, ...) (*schemaregistrypb.SchemaMode, error)
- type OperationIterator
Examples ¶
- ManagedSchemaRegistryClient.CancelOperation
- ManagedSchemaRegistryClient.CheckCompatibility
- ManagedSchemaRegistryClient.CreateSchemaRegistry
- ManagedSchemaRegistryClient.CreateVersion
- ManagedSchemaRegistryClient.DeleteOperation
- ManagedSchemaRegistryClient.DeleteSchemaConfig
- ManagedSchemaRegistryClient.DeleteSchemaMode
- ManagedSchemaRegistryClient.DeleteSchemaRegistry
- ManagedSchemaRegistryClient.DeleteSubject
- ManagedSchemaRegistryClient.DeleteVersion
- ManagedSchemaRegistryClient.GetContext
- ManagedSchemaRegistryClient.GetLocation
- ManagedSchemaRegistryClient.GetOperation
- ManagedSchemaRegistryClient.GetRawSchema
- ManagedSchemaRegistryClient.GetRawSchemaVersion
- ManagedSchemaRegistryClient.GetSchema
- ManagedSchemaRegistryClient.GetSchemaConfig
- ManagedSchemaRegistryClient.GetSchemaMode
- ManagedSchemaRegistryClient.GetSchemaRegistry
- ManagedSchemaRegistryClient.GetVersion
- ManagedSchemaRegistryClient.ListContexts
- ManagedSchemaRegistryClient.ListLocations
- ManagedSchemaRegistryClient.ListLocations (All)
- ManagedSchemaRegistryClient.ListOperations
- ManagedSchemaRegistryClient.ListOperations (All)
- ManagedSchemaRegistryClient.ListReferencedSchemas
- ManagedSchemaRegistryClient.ListSchemaRegistries
- ManagedSchemaRegistryClient.ListSchemaTypes
- ManagedSchemaRegistryClient.ListSchemaVersions
- ManagedSchemaRegistryClient.ListSubjects
- ManagedSchemaRegistryClient.ListSubjectsBySchemaId
- ManagedSchemaRegistryClient.ListVersions
- ManagedSchemaRegistryClient.LookupVersion
- ManagedSchemaRegistryClient.UpdateSchemaConfig
- ManagedSchemaRegistryClient.UpdateSchemaMode
- NewManagedSchemaRegistryClient
- NewManagedSchemaRegistryRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.
type 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) error
CancelOperation 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() error
Close 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.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 (*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) error
DeleteOperation 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) error
DeleteSchemaRegistry 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) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
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)
}
}
Example (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) *OperationIterator
ListOperations 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"
"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)
}
}
Example (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
}
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.