remote

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OperationCompact     = "COMPACT"
	OperationTxn         = "TXN"
	OperationLeaseGrant  = "LEASE_GRANT"
	OperationLeaseRenew  = "LEASE_RENEW"
	OperationLeaseRevoke = "LEASE_REVOKE"
	OperationSyncMembers = "SYNC"
)

Variables

View Source
var ErrGetLeaderFailed = errors.New("get leader failed")
View Source
var FirstEndpoint string

Functions

func NewClient

func NewClient(cfg etcdadpt.Config) etcdadpt.Client

func TracingBegin

func TracingBegin(ctx context.Context, operationName string, op etcdadpt.OpOptions) interface{}

func TracingEnd

func TracingEnd(span interface{}, err error)

Types

type Client

type Client struct {
	Cfg    etcdadpt.Config
	Client *clientv3.Client

	Endpoints        []string
	DialTimeout      time.Duration
	AutoSyncInterval time.Duration
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close()

func (*Client) Compact

func (c *Client) Compact(ctx context.Context, reserve int64) error

func (*Client) Do

func (c *Client) Do(ctx context.Context, opts ...etcdadpt.OpOption) (*etcdadpt.Response, error)

func (*Client) Err

func (c *Client) Err() <-chan error

func (*Client) GetEndpointStatus

func (c *Client) GetEndpointStatus(ctx context.Context, ep string) (*clientv3.StatusResponse, error)

func (*Client) HealthCheck

func (c *Client) HealthCheck()

func (*Client) HealthCheckLoop

func (c *Client) HealthCheckLoop(ctx context.Context)

func (*Client) Initialize

func (c *Client) Initialize() (err error)

func (*Client) LargeRequestPaging added in v0.1.3

func (c *Client) LargeRequestPaging(ctx context.Context, op etcdadpt.OpOptions) (*clientv3.GetResponse, error)

func (*Client) LeaseGrant

func (c *Client) LeaseGrant(ctx context.Context, TTL int64) (int64, error)

func (*Client) LeaseRenew

func (c *Client) LeaseRenew(ctx context.Context, leaseID int64) (int64, error)

func (*Client) LeaseRevoke

func (c *Client) LeaseRevoke(ctx context.Context, leaseID int64) error

func (*Client) ListCluster

func (c *Client) ListCluster(ctx context.Context) (etcdadpt.Clusters, error)

func (*Client) ReOpen

func (c *Client) ReOpen() error

func (*Client) Ready

func (c *Client) Ready() <-chan struct{}

func (*Client) Status added in v0.5.0

func (c *Client) Status(ctx context.Context) (*etcdadpt.StatusResponse, error)

func (*Client) SyncMembers

func (c *Client) SyncMembers(ctx context.Context) error

func (*Client) Txn

func (c *Client) Txn(ctx context.Context, opts []etcdadpt.OpOptions) (*etcdadpt.Response, error)

func (*Client) TxnWithCmp

func (c *Client) TxnWithCmp(ctx context.Context, success []etcdadpt.OpOptions, cmps []etcdadpt.CmpOptions, fail []etcdadpt.OpOptions) (*etcdadpt.Response, error)

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, opts ...etcdadpt.OpOption) (err error)

func (*Client) WithTimeout

func (c *Client) WithTimeout(ctx context.Context) (context.Context, context.CancelFunc)

Jump to

Keyboard shortcuts

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