server

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 22 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = status.New(codes.InvalidArgument, "etcdserver: unsupported operations in txn request").Err()

	ErrKeyExists = rpctypes.ErrGRPCDuplicateKey
	ErrCompacted = rpctypes.ErrGRPCCompacted
	ErrFutureRev = rpctypes.ErrGRPCFutureRev
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Start(ctx context.Context) error
	Get(ctx context.Context, key, rangeEnd string, limit, revision int64) (int64, *KeyValue, error)
	Create(ctx context.Context, key string, value []byte, lease int64) (int64, error)
	Delete(ctx context.Context, key string, revision int64) (int64, *KeyValue, bool, error)
	List(ctx context.Context, prefix, startKey string, limit, revision int64) (int64, []*KeyValue, error)
	Count(ctx context.Context, prefix, startKey string, revision int64) (int64, int64, error)
	Update(ctx context.Context, key string, value []byte, revision, lease int64) (int64, *KeyValue, bool, error)
	Watch(ctx context.Context, key string, revision int64) WatchResult
	DbSize(ctx context.Context) (int64, error)
	CurrentRevision(ctx context.Context) (int64, error)
	Compact(ctx context.Context, revision int64) (int64, error)
}

type Dialect added in v0.8.0

type Dialect interface {
	ListCurrent(ctx context.Context, prefix, startKey string, limit int64, includeDeleted bool) (*sql.Rows, error)
	List(ctx context.Context, prefix, startKey string, limit, revision int64, includeDeleted bool) (*sql.Rows, error)
	CountCurrent(ctx context.Context, prefix, startKey string) (int64, int64, error)
	Count(ctx context.Context, prefix, startKey string, revision int64) (int64, int64, error)
	CurrentRevision(ctx context.Context) (int64, error)
	After(ctx context.Context, prefix string, rev, limit int64) (*sql.Rows, error)
	//nolint:revive
	Insert(ctx context.Context, key string, create, delete bool, createRevision, previousRevision int64, ttl int64, value, prevValue []byte) (int64, error)
	GetRevision(ctx context.Context, revision int64) (*sql.Rows, error)
	DeleteRevision(ctx context.Context, revision int64) error
	GetCompactRevision(ctx context.Context) (int64, error)
	SetCompactRevision(ctx context.Context, revision int64) error
	Compact(ctx context.Context, revision int64) (int64, error)
	PostCompact(ctx context.Context) error
	Fill(ctx context.Context, revision int64) error
	IsFill(key string) bool
	BeginTx(ctx context.Context, opts *sql.TxOptions) (Transaction, error)
	GetSize(ctx context.Context) (int64, error)
	FillRetryDelay(ctx context.Context)
}

type Event

type Event struct {
	Delete bool
	Create bool
	KV     *KeyValue
	PrevKV *KeyValue
}

type KVServerBridge

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

func New

func New(backend Backend, scheme string, notifyInterval time.Duration, emulatedETCDVersion string) *KVServerBridge

func (*KVServerBridge) Alarm added in v0.8.0

func (*KVServerBridge) Defragment added in v0.8.0

func (*KVServerBridge) Downgrade added in v0.8.0

func (*KVServerBridge) Hash added in v0.8.0

func (*KVServerBridge) HashKV added in v0.8.0

func (*KVServerBridge) LeaseGrant

func (*KVServerBridge) LeaseKeepAlive

func (*KVServerBridge) MemberAdd added in v0.8.0

func (*KVServerBridge) MemberList added in v0.8.0

func (*KVServerBridge) MemberPromote added in v0.8.0

func (*KVServerBridge) MemberRemove added in v0.8.0

func (*KVServerBridge) MemberUpdate added in v0.8.0

func (*KVServerBridge) MoveLeader added in v0.8.0

func (*KVServerBridge) Put

func (*KVServerBridge) Range

func (*KVServerBridge) Register

func (k *KVServerBridge) Register(server *grpc.Server)

func (*KVServerBridge) Snapshot added in v0.8.0

func (*KVServerBridge) Status added in v0.8.0

func (*KVServerBridge) Txn

func (*KVServerBridge) Watch

type KeyValue

type KeyValue struct {
	Key            string
	CreateRevision int64
	ModRevision    int64
	Value          []byte
	Lease          int64
}

type LimitedServer

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

func (*LimitedServer) Compact added in v0.11.9

func (*LimitedServer) Range

func (*LimitedServer) Txn

type RangeResponse

type RangeResponse struct {
	Header *etcdserverpb.ResponseHeader
	Kvs    []*KeyValue
	More   bool
	Count  int64
}

type ResponseHeader

type ResponseHeader struct {
	Revision int64
}

type Transaction added in v0.8.0

type Transaction interface {
	Commit() error
	MustCommit()
	Rollback() error
	MustRollback()
	GetCompactRevision(ctx context.Context) (int64, error)
	SetCompactRevision(ctx context.Context, revision int64) error
	Compact(ctx context.Context, revision int64) (int64, error)
	GetRevision(ctx context.Context, revision int64) (*sql.Rows, error)
	DeleteRevision(ctx context.Context, revision int64) error
	CurrentRevision(ctx context.Context) (int64, error)
}

type WatchResult added in v0.11.0

type WatchResult struct {
	CurrentRevision int64
	CompactRevision int64
	Events          <-chan []*Event
}

Jump to

Keyboard shortcuts

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