Cloud Spanner API v1 - Package cloud.google.com/go/spanner/adapter/apiv1/adapterpb (v1.91.0)

Constants

Adapter_CreateSession_FullMethodName, Adapter_AdaptMessage_FullMethodName

const (
	Adapter_CreateSession_FullMethodName = "/google.spanner.adapter.v1.Adapter/CreateSession"
	Adapter_AdaptMessage_FullMethodName  = "/google.spanner.adapter.v1.Adapter/AdaptMessage"
)

Variables

Adapter_ServiceDesc

var Adapter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "google.spanner.adapter.v1.Adapter",
	HandlerType: (*AdapterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateSession",
			Handler:    _Adapter_CreateSession_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "AdaptMessage",
			Handler:       _Adapter_AdaptMessage_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "google/spanner/adapter/v1/adapter.proto",
}

Adapter_ServiceDesc is the grpc.ServiceDesc for Adapter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

File_google_spanner_adapter_v1_adapter_proto

var File_google_spanner_adapter_v1_adapter_proto protoreflect.FileDescriptor

Functions

func RegisterAdapterServer

func RegisterAdapterServer(s grpc.ServiceRegistrar, srv AdapterServer)

AdaptMessageRequest

type AdaptMessageRequest struct {

	// Required. The database session in which the adapter request is processed.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required. Identifier for the underlying wire protocol.
	Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// Optional. Uninterpreted bytes from the underlying wire protocol.
	Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// Optional. Opaque request state passed by the client to the server.
	Attachments map[string]string `protobuf:"bytes,4,rep,name=attachments,proto3" json:"attachments,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// contains filtered or unexported fields
}

Message sent by the client to the adapter.

func (*AdaptMessageRequest) Descriptor

func (*AdaptMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use AdaptMessageRequest.ProtoReflect.Descriptor instead.

func (*AdaptMessageRequest) GetAttachments

func (x *AdaptMessageRequest) GetAttachments() map[string]string

func (*AdaptMessageRequest) GetName

func (x *AdaptMessageRequest) GetName() string

func (*AdaptMessageRequest) GetPayload

func (x *AdaptMessageRequest) GetPayload() []byte

func (*AdaptMessageRequest) GetProtocol

func (x *AdaptMessageRequest) GetProtocol() string

func (*AdaptMessageRequest) ProtoMessage

func (*AdaptMessageRequest) ProtoMessage()

func (*AdaptMessageRequest) ProtoReflect

func (x *AdaptMessageRequest) ProtoReflect() protoreflect.Message

func (*AdaptMessageRequest) Reset

func (x *AdaptMessageRequest) Reset()

func (*AdaptMessageRequest) String

func (x *AdaptMessageRequest) String() string

AdaptMessageResponse

type AdaptMessageResponse struct {

	// Optional. Uninterpreted bytes from the underlying wire protocol.
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// Optional. Opaque state updates to be applied by the client.
	StateUpdates map[string]string `protobuf:"bytes,2,rep,name=state_updates,json=stateUpdates,proto3" json:"state_updates,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// Optional. Indicates whether this is the last
	// [AdaptMessageResponse][google.spanner.adapter.v1.AdaptMessageResponse] in
	// the stream. This field may be optionally set by the server. Clients should
	// not rely on this field being set in all cases.
	Last bool `protobuf:"varint,3,opt,name=last,proto3" json:"last,omitempty"`
	// contains filtered or unexported fields
}

Message sent by the adapter to the client.

func (*AdaptMessageResponse) Descriptor

func (*AdaptMessageResponse) Descriptor() ([]byte, []int)

Deprecated: Use AdaptMessageResponse.ProtoReflect.Descriptor instead.

func (*AdaptMessageResponse) GetLast

func (x *AdaptMessageResponse) GetLast() bool

func (*AdaptMessageResponse) GetPayload

func (x *AdaptMessageResponse) GetPayload() []byte

func (*AdaptMessageResponse) GetStateUpdates

func (x *AdaptMessageResponse) GetStateUpdates() map[string]string

func (*AdaptMessageResponse) ProtoMessage

func (*AdaptMessageResponse) ProtoMessage()

func (*AdaptMessageResponse) ProtoReflect

func (x *AdaptMessageResponse) ProtoReflect() protoreflect.Message

func (*AdaptMessageResponse) Reset

func (x *AdaptMessageResponse) Reset()

func (*AdaptMessageResponse) String

func (x *AdaptMessageResponse) String() string

AdapterClient

type AdapterClient interface {
	// Creates a new session to be used for requests made by the adapter.
	// A session identifies a specific incarnation of a database resource and is
	// meant to be reused across many `AdaptMessage` calls.
	CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Session, error)
	// Handles a single message from the client and returns the result as a
	// stream. The server will interpret the message frame and respond with
	// message frames to the client.
	AdaptMessage(ctx context.Context, in *AdaptMessageRequest, opts ...grpc.CallOption) (Adapter_AdaptMessageClient, error)
}

AdapterClient is the client API for Adapter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAdapterClient

func NewAdapterClient(cc grpc.ClientConnInterface) AdapterClient

AdapterServer

type AdapterServer interface {
	// Creates a new session to be used for requests made by the adapter.
	// A session identifies a specific incarnation of a database resource and is
	// meant to be reused across many `AdaptMessage` calls.
	CreateSession(context.Context, *CreateSessionRequest) (*Session, error)
	// Handles a single message from the client and returns the result as a
	// stream. The server will interpret the message frame and respond with
	// message frames to the client.
	AdaptMessage(*AdaptMessageRequest, Adapter_AdaptMessageServer) error
}

AdapterServer is the server API for Adapter service. All implementations should embed UnimplementedAdapterServer for forward compatibility

Adapter_AdaptMessageClient

type Adapter_AdaptMessageClient interface {
	Recv() (*AdaptMessageResponse, error)
	grpc.ClientStream
}

Adapter_AdaptMessageServer

type Adapter_AdaptMessageServer interface {
	Send(*AdaptMessageResponse) error
	grpc.ServerStream
}

CreateSessionRequest

type CreateSessionRequest struct {

	// Required. The database in which the new session is created.
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// Required. The session to create.
	Session *Session `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

The request for [CreateSessionRequest][Adapter.CreateSessionRequest].

func (*CreateSessionRequest) Descriptor

func (*CreateSessionRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateSessionRequest.ProtoReflect.Descriptor instead.

func (*CreateSessionRequest) GetParent

func (x *CreateSessionRequest) GetParent() string

func (*CreateSessionRequest) GetSession

func (x *CreateSessionRequest) GetSession() *Session

func (*CreateSessionRequest) ProtoMessage

func (*CreateSessionRequest) ProtoMessage()

func (*CreateSessionRequest) ProtoReflect

func (x *CreateSessionRequest) ProtoReflect() protoreflect.Message

func (*CreateSessionRequest) Reset

func (x *CreateSessionRequest) Reset()

func (*CreateSessionRequest) String

func (x *CreateSessionRequest) String() string

Session

type Session struct {

	// Identifier. The name of the session. This is always system-assigned.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

A session in the Cloud Spanner Adapter API.

func (*Session) Descriptor

func (*Session) Descriptor() ([]byte, []int)

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetName

func (x *Session) GetName() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

func (x *Session) ProtoReflect() protoreflect.Message

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

UnimplementedAdapterServer

type UnimplementedAdapterServer struct {
}

UnimplementedAdapterServer should be embedded to have forward compatible implementations.

func (UnimplementedAdapterServer) AdaptMessage

func (UnimplementedAdapterServer) CreateSession

UnsafeAdapterServer

type UnsafeAdapterServer interface {
	// contains filtered or unexported methods
}

UnsafeAdapterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AdapterServer will result in compilation errors.