package testutil

import "github.com/ydb-platform/ydb-go-sdk/v3/testutil"

Index

Variables

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

Source Files

backoff.go driver.go file_line.go session.go time.go

Directories

PathSynopsis
testutil/timeutil
testutil/timeutil/timetest
Version
v3.4.4
Published
Dec 9, 2021
Platform
windows/amd64
Imports
16 packages
Last checked
3 minutes ago

Tools for package owners.