testutil

package
v3.66.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotComparable = xerrors.Wrap(fmt.Errorf("not comparable"))
View Source
var ErrNotImplemented = xerrors.Wrap(fmt.Errorf("testutil: not implemented"))

Functions

func Compare added in v3.5.0

func Compare(l, r value.Value) (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 FileLine

func FileLine(skip int) string

func NewBalancer added in v3.34.0

func NewBalancer(opts ...balancerOption) *balancerStub

func QueryBind added in v3.44.0

func QueryBind(bindings ...bind.Bind) bind.Bindings

func SessionID

func SessionID(opts ...sessionIDOption) string

func WithInvokeHandlers

func WithInvokeHandlers(invokeHandlers InvokeHandlers) balancerOption

func WithNewStreamHandlers

func WithNewStreamHandlers(newStreamHandlers NewStreamHandlers) balancerOption

func WithNodeID added in v3.44.0

func WithNodeID(nodeID uint32) sessionIDOption

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) Delay added in v3.21.0

func (f BackoffFunc) Delay(i int) time.Duration

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 QueryBindings added in v3.44.0

type QueryBindings = bind.Bindings

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

type TopicReaderMessageBuilder added in v3.48.6

type TopicReaderMessageBuilder = topicreaderinternal.PublicMessageBuilder

func NewTopicReaderMessageBuilder added in v3.48.6

func NewTopicReaderMessageBuilder() *TopicReaderMessageBuilder

NewTopicReaderMessageBuilder create builder, which can create Message (use for tests only)

Jump to

Keyboard shortcuts

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