client

package
v0.0.0-...-c097f9c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*TSOClient)

func WithGRPCDialOption

func WithGRPCDialOption(opts ...grpc.DialOption) Option

func WithMaxBatchSize

func WithMaxBatchSize(size uint32) Option

func WithMaxWaitTime

func WithMaxWaitTime(d time.Duration) Option

func WithMinBatchSize

func WithMinBatchSize(size uint32) Option

func WithTLSConfig

func WithTLSConfig(config *tls.Config) Option

type TSOClient

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

Client state

func NewTSOClient

func NewTSOClient(endpoints []string, opts ...Option) (*TSOClient, error)

NewTSOClient creates a new TSO client

func (*TSOClient) Close

func (c *TSOClient) Close()

Close closes the client

func (*TSOClient) GetTimestamp

func (c *TSOClient) GetTimestamp(ctx context.Context) (TSOFuture, error)

GetTimestamp asynchronously gets a timestamp and returns a TSOFuture

type TSOFuture

type TSOFuture interface {
	// Wait gets the physical and logical time, it would block caller if data is not available yet.
	Wait() (int64, int64, error)
}

Jump to

Keyboard shortcuts

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