Documentation ¶
Index ¶
- Variables
- func EncodeResumeToken(t uint64) []byte
- type MockCloudSpanner
- func (m *MockCloudSpanner) Addr() string
- func (m *MockCloudSpanner) CreateSession(c context.Context, r *sppb.CreateSessionRequest) (*sppb.Session, error)
- func (m *MockCloudSpanner) DeleteSession(c context.Context, r *sppb.DeleteSessionRequest) (*empty.Empty, error)
- func (m *MockCloudSpanner) ExecuteStreamingSql(r *sppb.ExecuteSqlRequest, s sppb.Spanner_ExecuteStreamingSqlServer) error
- func (m *MockCloudSpanner) Serve() error
- func (m *MockCloudSpanner) Stop()
- func (m *MockCloudSpanner) StreamingRead(r *sppb.ReadRequest, s sppb.Spanner_StreamingReadServer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // KvMeta is the Metadata for mocked KV table. KvMeta = sppb.ResultSetMetadata{ RowType: &sppb.StructType{ Fields: []*sppb.StructType_Field{ { Name: "Key", Type: &sppb.Type{Code: sppb.TypeCode_STRING}, }, { Name: "Value", Type: &sppb.Type{Code: sppb.TypeCode_STRING}, }, }, }, } )
Functions ¶
func EncodeResumeToken ¶
EncodeResumeToken return mock resume token encoding for an uint64 integer.
Types ¶
type MockCloudSpanner ¶
type MockCloudSpanner struct { sppb.SpannerServer // contains filtered or unexported fields }
MockCloudSpanner is a mock implementation of SpannerServer interface.
func NewMockCloudSpanner ¶
func NewMockCloudSpanner() (*MockCloudSpanner, error)
NewMockCloudSpanner creates a new MockCloudSpanner instance.
func (*MockCloudSpanner) Addr ¶
func (m *MockCloudSpanner) Addr() string
Addr returns the listening address of mock server.
func (*MockCloudSpanner) CreateSession ¶
func (m *MockCloudSpanner) CreateSession(c context.Context, r *sppb.CreateSessionRequest) (*sppb.Session, error)
CreateSession is a placeholder for SpannerServer.CreateSession.
func (*MockCloudSpanner) DeleteSession ¶
func (m *MockCloudSpanner) DeleteSession(c context.Context, r *sppb.DeleteSessionRequest) (*empty.Empty, error)
DeleteSession is a placeholder for SpannerServer.DeleteSession.
func (*MockCloudSpanner) ExecuteStreamingSql ¶
func (m *MockCloudSpanner) ExecuteStreamingSql(r *sppb.ExecuteSqlRequest, s sppb.Spanner_ExecuteStreamingSqlServer) error
ExecuteStreamingSql is a mock implementation of SpannerServer.ExecuteStreamingSql.
func (*MockCloudSpanner) Serve ¶
func (m *MockCloudSpanner) Serve() error
Serve starts the server and blocks.
func (*MockCloudSpanner) Stop ¶
func (m *MockCloudSpanner) Stop()
Stop terminates MockCloudSpanner and closes the serving port.
func (*MockCloudSpanner) StreamingRead ¶
func (m *MockCloudSpanner) StreamingRead(r *sppb.ReadRequest, s sppb.Spanner_StreamingReadServer) error
StreamingRead is a placeholder for SpannerServer.StreamingRead.
Click to show internal directories.
Click to hide internal directories.