Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequestFastFail ¶
func NewRequestFastFail(err error) *tsoRequestFastFail
NewRequestFastFail creates a new fast fail TSO request.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
Cli is the implementation of the TSO client.
func NewClient ¶
func NewClient( ctx context.Context, option *opt.Option, svcDiscovery sd.ServiceDiscovery, factory tsoStreamBuilderFactory, ) *Cli
NewClient returns a new TSO client.
func (*Cli) DispatchRequest ¶
DispatchRequest will send the TSO request to the corresponding TSO dispatcher.
func (*Cli) GetRequestPool ¶
GetRequestPool gets the request pool of the TSO client.
func (*Cli) GetTSORequest ¶
GetTSORequest gets a TSO request from the pool.
type Client ¶
type Client interface { // GetTS gets a timestamp from PD or TSO microservice. GetTS(ctx context.Context) (int64, int64, error) // GetTSAsync gets a timestamp from PD or TSO microservice, without block the caller. GetTSAsync(ctx context.Context) TSFuture // GetMinTS gets a timestamp from PD or the minimal timestamp across all keyspace groups from // the TSO microservice. GetMinTS(ctx context.Context) (int64, int64, error) // GetLocalTS gets a local timestamp from PD or TSO microservice. // // Deprecated: Local TSO will be completely removed in the future. Currently, regardless of the // parameters passed in, this method will default to returning the global TSO. GetLocalTS(ctx context.Context, _ string) (int64, int64, error) // GetLocalTSAsync gets a local timestamp from PD or TSO microservice, without block the caller. // // Deprecated: Local TSO will be completely removed in the future. Currently, regardless of the // parameters passed in, this method will default to returning the global TSO. GetLocalTSAsync(ctx context.Context, _ string) TSFuture }
Client defines the interface of a TSO client.
type MSStreamBuilderFactory ¶
type MSStreamBuilderFactory struct{}
MSStreamBuilderFactory is a factory for building TSO streams to the microservice cluster.
type PDStreamBuilderFactory ¶
type PDStreamBuilderFactory struct{}
PDStreamBuilderFactory is a factory for building TSO streams to the PD cluster.
Click to show internal directories.
Click to hide internal directories.