backend

package
v0.0.0-...-27e8298 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialTimeout  = 5 * time.Second
	ReadTimeout  = 5 * time.Second
	WriteTimeout = 5 * time.Second

	RetryTimes = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	*v3.Client
}

func NewStorage

func NewStorage(endPoints []string, user, password string) (*Storage, error)

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, key string, opts ...v3.OpOption) (resp *v3.DeleteResponse, err error)

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, key string, opts ...v3.OpOption) (resp *v3.GetResponse, err error)

func (*Storage) NewElection

func (s *Storage) NewElection(key string) (*concurrency.Election, error)

func (*Storage) NewMutex

func (s *Storage) NewMutex(key string) (*concurrency.Mutex, error)

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, key, value string, opts ...v3.OpOption) (resp *v3.PutResponse, err error)

Jump to

Keyboard shortcuts

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