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.FileDescriptorFunctions
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]stringfunc (*AdaptMessageRequest) GetName
func (x *AdaptMessageRequest) GetName() stringfunc (*AdaptMessageRequest) GetPayload
func (x *AdaptMessageRequest) GetPayload() []bytefunc (*AdaptMessageRequest) GetProtocol
func (x *AdaptMessageRequest) GetProtocol() stringfunc (*AdaptMessageRequest) ProtoMessage
func (*AdaptMessageRequest) ProtoMessage()func (*AdaptMessageRequest) ProtoReflect
func (x *AdaptMessageRequest) ProtoReflect() protoreflect.Messagefunc (*AdaptMessageRequest) Reset
func (x *AdaptMessageRequest) Reset()func (*AdaptMessageRequest) String
func (x *AdaptMessageRequest) String() stringAdaptMessageResponse
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() boolfunc (*AdaptMessageResponse) GetPayload
func (x *AdaptMessageResponse) GetPayload() []bytefunc (*AdaptMessageResponse) GetStateUpdates
func (x *AdaptMessageResponse) GetStateUpdates() map[string]stringfunc (*AdaptMessageResponse) ProtoMessage
func (*AdaptMessageResponse) ProtoMessage()func (*AdaptMessageResponse) ProtoReflect
func (x *AdaptMessageResponse) ProtoReflect() protoreflect.Messagefunc (*AdaptMessageResponse) Reset
func (x *AdaptMessageResponse) Reset()func (*AdaptMessageResponse) String
func (x *AdaptMessageResponse) String() stringAdapterClient
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) AdapterClientAdapterServer
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() stringfunc (*CreateSessionRequest) GetSession
func (x *CreateSessionRequest) GetSession() *Sessionfunc (*CreateSessionRequest) ProtoMessage
func (*CreateSessionRequest) ProtoMessage()func (*CreateSessionRequest) ProtoReflect
func (x *CreateSessionRequest) ProtoReflect() protoreflect.Messagefunc (*CreateSessionRequest) Reset
func (x *CreateSessionRequest) Reset()func (*CreateSessionRequest) String
func (x *CreateSessionRequest) String() stringSession
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
Deprecated: Use Session.ProtoReflect.Descriptor instead.
func (*Session) GetName
func (*Session) ProtoMessage
func (*Session) ProtoMessage()func (*Session) ProtoReflect
func (x *Session) ProtoReflect() protoreflect.Messagefunc (*Session) Reset
func (x *Session) Reset()func (*Session) String
UnimplementedAdapterServer
type UnimplementedAdapterServer struct {
}UnimplementedAdapterServer should be embedded to have forward compatible implementations.
func (UnimplementedAdapterServer) AdaptMessage
func (UnimplementedAdapterServer) AdaptMessage(*AdaptMessageRequest, Adapter_AdaptMessageServer) errorfunc (UnimplementedAdapterServer) CreateSession
func (UnimplementedAdapterServer) CreateSession(context.Context, *CreateSessionRequest) (*Session, error)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.