testutil

package
v3.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("testutil: not implemented")

Functions

func FileLine

func FileLine(skip int) string

func NewCluster

func NewCluster(opts ...NewClusterOption) cluster.Cluster

func SessionID

func SessionID(opts ...sessionIDOption) string

func WithServiceID

func WithServiceID(serviceID uint32) sessionIDOption

Types

type BackoffFunc

type BackoffFunc func(n int) <-chan time.Time

BackoffFunc is an adapter to allow the use of ordinary functions as Backoff.

func (BackoffFunc) Wait

func (f BackoffFunc) Wait(n int) <-chan time.Time

Wait implements Backoff interface.

type ClientStream

type ClientStream struct {
	OnHeader    func() (metadata.MD, error)
	OnTrailer   func() metadata.MD
	OnCloseSend func() error
	OnContext   func() context.Context
	OnSendMsg   func(m interface{}) error
	OnRecvMsg   func(m interface{}) error
}

func (*ClientStream) CloseSend

func (s *ClientStream) CloseSend() error

func (*ClientStream) Context

func (s *ClientStream) Context() context.Context

func (*ClientStream) Header

func (s *ClientStream) Header() (metadata.MD, error)

func (*ClientStream) RecvMsg

func (s *ClientStream) RecvMsg(m interface{}) error

func (*ClientStream) SendMsg

func (s *ClientStream) SendMsg(m interface{}) error

func (*ClientStream) Trailer

func (s *ClientStream) Trailer() metadata.MD

type InvokeHandlers

type InvokeHandlers map[MethodCode]func(request interface{}) (result proto.Message, err error)

type Method

type Method string

func (Method) Code

func (m Method) Code() MethodCode

type MethodCode

type MethodCode uint
const (
	UnknownMethod MethodCode = iota
	TableCreateSession
	TableDeleteSession
	TableKeepAlive
	TableCreateTable
	TableDropTable
	TableAlterTable
	TableCopyTable
	TableDescribeTable
	TableExplainDataQuery
	TablePrepareDataQuery
	TableExecuteDataQuery
	TableExecuteSchemeQuery
	TableBeginTransaction
	TableCommitTransaction
	TableRollbackTransaction
	TableDescribeTableOptions
	TableStreamReadTable
	TableStreamExecuteScanQuery
)

func (MethodCode) String

func (m MethodCode) String() string

type NewClusterOption

type NewClusterOption func(c *db)

func WithClose

func WithClose(onClose func(ctx context.Context) error) NewClusterOption

func WithInvokeHandlers

func WithInvokeHandlers(invokeHandlers InvokeHandlers) NewClusterOption

func WithNewStreamHandlers

func WithNewStreamHandlers(newStreamHandlers NewStreamHandlers) NewClusterOption

type NewStreamHandlers

type NewStreamHandlers map[MethodCode]func(desc *grpc.StreamDesc) (grpc.ClientStream, error)

type StubTicker

type StubTicker struct {
	// contains filtered or unexported fields
}

func (StubTicker) Destroy

func (s StubTicker) Destroy()

func (*StubTicker) Emit

func (s *StubTicker) Emit(t time.Time)

func (*StubTicker) Reset

func (s *StubTicker) Reset(d time.Duration, f func(time.Time))

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL