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) // Deprecated: the Local TSO feature has been deprecated. Regardless of the // parameters passed, the behavior of this interface will be equivalent to // `GetTS`. If you want to use a separately deployed TSO service, // please refer to the deployment of the TSO microservice. GetLocalTS(ctx context.Context, _ string) (int64, int64, error) // Deprecated: the Local TSO feature has been deprecated. Regardless of the // parameters passed, the behavior of this interface will be equivalent to // `GetTSAsync`. If you want to use a separately deployed TSO service, // please refer to the deployment of the TSO microservice. 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.