global

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ID

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

func NewID

func NewID(conf *config.AppConfig, client pb.IdSvcClient) *ID

func (*ID) Generate

func (i *ID) Generate(ctx context.Context) int64

type Lock

type Lock struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func (*Lock) Release

func (l *Lock) Release() error

type Locker

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

func NewLocker

func NewLocker(client *etcd.Client) *Locker

func (*Locker) Acquire

func (l *Locker) Acquire(key string, opts ...LockerOpt) (*Lock, error)

type LockerOpt

type LockerOpt func(op *Operation)

func WithAcquireTimeout

func WithAcquireTimeout(timeout time.Duration) LockerOpt

func WithLockTTL

func WithLockTTL(ttl time.Duration) LockerOpt

func WithTry

func WithTry(try bool) LockerOpt

type Operation

type Operation struct {
	AcquireTimeout time.Duration
	TTL            time.Duration
	Try            bool
}

type Transaction

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

func NewTransaction

func NewTransaction(conf *config.AppConfig) *Transaction

func (*Transaction) TCC

func (t *Transaction) TCC(tccFunc dtmgrpc.TccGlobalFunc) (string, error)

Jump to

Keyboard shortcuts

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