testutil

package
v3.11.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Compare added in v3.5.0

func Compare(l, r value.V) (int, error)

Compare compares its operands. It returns -1, 0, 1 if l < r, l == r, l > r. Returns error if types are not comparable. Comparable types are all integer types, UUID, DyNumber, Float, Double, String, UTF8, Date, Datetime, Timestamp, Tuples and Lists. Primitive arguments are comparable if their types are the same. Optional types is comparable to underlying types, e.g. Optional<Optional<Float>> is comparable to Float. Null value is comparable to non-null value of the same types and is considered less than any non-null value. Tuples and Lists are comparable if their elements are comparable. Tuples and Lists are compared lexicographically. If tuples (lists) have different length and elements of the shorter tuple (list) are all equal to corresponding elements of the other tuple (list), than the shorter tuple (list) is considered less than the longer one.

func Equal added in v3.5.0

func Equal(t *testing.T, expected, actual interface{})

func FileLine

func FileLine(skip int) string

func NewDB added in v3.8.0

func NewDB(opts ...dbOption) db.Cluster

func NoError added in v3.5.0

func NoError(t *testing.T, err error)

func NotNil added in v3.5.0

func NotNil(t *testing.T, value interface{})

func SessionID

func SessionID(opts ...sessionIDOption) string

func WithClose

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

func WithInvokeHandlers

func WithInvokeHandlers(invokeHandlers InvokeHandlers) dbOption

func WithNewStreamHandlers

func WithNewStreamHandlers(newStreamHandlers NewStreamHandlers) dbOption

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 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