storage

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ConcurrentSet = "/SAIL/ConcurrentSet"

Variables

This section is empty.

Functions

This section is empty.

Types

type ETCDConfig

type ETCDConfig struct {
	Endpoints            []string
	DialTimeout          time.Duration
	DialKeepAlive        time.Duration
	DialKeepAliveTimeout time.Duration
	Username             string
	Password             string
}

type GetResponse

type GetResponse struct {
	Value string

	Revision int
	Err      error
}

type Repo

type Repo interface {
	Set(ctx context.Context, key string, value string) SetResponse
	AtomicBatchSet(ctx context.Context, key []string, value []string, callback ...func()) SetResponse
	Get(ctx context.Context, key string) GetResponse
	ConcurrentSet(ctx context.Context, key string, value string) SetResponse
	GetWithReversion(ctx context.Context, key string, reversion int) GetResponse
	Del(ctx context.Context, key string) (bool, error)
	Close() error
}

func New

func New(cfg *ETCDConfig) (Repo, error)

type SetResponse

type SetResponse struct {
	Revision int
	Err      error
}

Jump to

Keyboard shortcuts

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