Documentation
¶
Overview ¶
This file is copied from https://github.com/googleapis/google-cloud-go/blob/main/bigtable/internal/mockserver/inmem.go with minor modification.
This file defines data types that allow the test cases to customize the behavior of mock server: "<operation>Action" types tell the server to either perform the operation or return an error. You can build a sequence of actions to make the server return streaming responses and (or) respond to ordered retry attempts, where the server will perform each action only once. "<operation>ReqRecord" types let the server log the request from client with timestamp.
Index ¶
- type RowStatus
- type Server
- func (s *Server) CheckAndMutateRow(ctx context.Context, srv *btpb.CheckAndMutateRowRequest) (*btpb.CheckAndMutateRowResponse, error)
- func (s *Server) Close() error
- func (s *Server) ExecuteQuery(req *btpb.ExecuteQueryRequest, srv btpb.Bigtable_ExecuteQueryServer) error
- func (s *Server) MutateRow(ctx context.Context, req *btpb.MutateRowRequest) (*btpb.MutateRowResponse, error)
- func (s *Server) MutateRows(req *btpb.MutateRowsRequest, srv btpb.Bigtable_MutateRowsServer) error
- func (s *Server) PrepareQuery(ctx context.Context, req *btpb.PrepareQueryRequest) (*btpb.PrepareQueryResponse, error)
- func (s *Server) ReadModifyWriteRow(ctx context.Context, srv *btpb.ReadModifyWriteRowRequest) (*btpb.ReadModifyWriteRowResponse, error)
- func (s *Server) ReadRows(req *btpb.ReadRowsRequest, srv btpb.Bigtable_ReadRowsServer) error
- func (s *Server) SampleRowKeys(req *btpb.SampleRowKeysRequest, srv btpb.Bigtable_SampleRowKeysServer) error
- func (s *Server) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RowStatus ¶
type RowStatus int
RowStatus is a Enum type to hold value for read row's status ranging from None to Drop below.
type Server ¶
type Server struct {
Addr string
// Any unimplemented methods will cause a panic when called.
btpb.BigtableServer
// ReadRowsFn mocks ReadRows.
ReadRowsFn func(*btpb.ReadRowsRequest, btpb.Bigtable_ReadRowsServer) error
// SampleRowKeysFn mocks SampleRowKeys.
SampleRowKeysFn func(*btpb.SampleRowKeysRequest, btpb.Bigtable_SampleRowKeysServer) error
// MutateRowFn mocks MutateRow.
MutateRowFn func(context.Context, *btpb.MutateRowRequest) (*btpb.MutateRowResponse, error)
// MutateRowsFn mocks MutateRows.
MutateRowsFn func(*btpb.MutateRowsRequest, btpb.Bigtable_MutateRowsServer) error
// CheckAndMutateRowFn mocks CheckAndMutateRow.
CheckAndMutateRowFn func(context.Context, *btpb.CheckAndMutateRowRequest) (*btpb.CheckAndMutateRowResponse, error)
// ReadModifyWriteRowFn mocks ReadModifyWriteRow.
ReadModifyWriteRowFn func(context.Context, *btpb.ReadModifyWriteRowRequest) (*btpb.ReadModifyWriteRowResponse, error)
// ExecuteQueryFn mocks ExecuteQuery
ExecuteQueryFn func(*btpb.ExecuteQueryRequest, btpb.Bigtable_ExecuteQueryServer) error
// PrepareQueryFn mocks PrepareQuery
PrepareQueryFn func(context.Context, *btpb.PrepareQueryRequest) (*btpb.PrepareQueryResponse, error)
// contains filtered or unexported fields
}
Server is an in-memory Cloud Bigtable fake. It is unauthenticated, and only a rough approximation.
func NewServer ¶
func NewServer(laddr string, opt ...grpc.ServerOption) (*Server, error)
NewServer creates a new Server. The Server will be listening for gRPC connections, without TLS, on the provided address. The resolved address is named by the Addr field.
func (*Server) CheckAndMutateRow ¶
func (s *Server) CheckAndMutateRow(ctx context.Context, srv *btpb.CheckAndMutateRowRequest) (*btpb.CheckAndMutateRowResponse, error)
CheckAndMutateRow implements CheckAndMutateRow of the BigtableServer interface.
func (*Server) ExecuteQuery ¶ added in v0.0.4
func (s *Server) ExecuteQuery(req *btpb.ExecuteQueryRequest, srv btpb.Bigtable_ExecuteQueryServer) error
func (*Server) MutateRow ¶
func (s *Server) MutateRow(ctx context.Context, req *btpb.MutateRowRequest) (*btpb.MutateRowResponse, error)
MutateRow implements MutateRow of the BigtableServer interface.
func (*Server) MutateRows ¶
func (s *Server) MutateRows(req *btpb.MutateRowsRequest, srv btpb.Bigtable_MutateRowsServer) error
MutateRows implements MutateRows of the BigtableServer interface.
func (*Server) PrepareQuery ¶ added in v0.0.4
func (s *Server) PrepareQuery(ctx context.Context, req *btpb.PrepareQueryRequest) (*btpb.PrepareQueryResponse, error)
func (*Server) ReadModifyWriteRow ¶
func (s *Server) ReadModifyWriteRow(ctx context.Context, srv *btpb.ReadModifyWriteRowRequest) (*btpb.ReadModifyWriteRowResponse, error)
ReadModifyWriteRow implements ReadModifyWriteRow of the BigtableServer interface.
func (*Server) ReadRows ¶
func (s *Server) ReadRows(req *btpb.ReadRowsRequest, srv btpb.Bigtable_ReadRowsServer) error
ReadRows implements ReadRows of the BigtableServer interface.
func (*Server) SampleRowKeys ¶
func (s *Server) SampleRowKeys(req *btpb.SampleRowKeysRequest, srv btpb.Bigtable_SampleRowKeysServer) error
SampleRowKeys implements SampleRowKeys of the BigtableServer interface.