types

package
v0.0.0-...-664f50f Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordToKV

func RecordToKV(record Record) *mvccpb.KeyValue

func RecordsToKVs

func RecordsToKVs(records []Record) []*mvccpb.KeyValue

Types

type LeaderElect

type LeaderElect interface {
	ElectionName() string
	MyName() string
	Elect(duration time.Duration) (bool, error)
	CurrentHolder() (string, error)
	ExpiresOn() (*time.Time, error)
	RenewTerm(duration time.Duration) (bool, error)
}

type Lease

type Lease struct {
	ID         int64
	Status     LeaseStatus
	GrantedTTL int64
	TTL        int64
}

type LeaseStatus

type LeaseStatus int
const (
	UnknownLeaseStatus LeaseStatus = 0
	ActiveLease        LeaseStatus = 1
	RevokedLease       LeaseStatus = 2
)

type Record

type Record interface {
	Key() []byte
	Value() []byte
	ModRevision() int64
	CreateRevision() int64
	PrevRevision() int64
	Lease() int64
	IsEventRecord() bool
	IsDeleteEvent() bool
	IsUpdateEvent() bool
	IsCreateEvent() bool
}

Jump to

Keyboard shortcuts

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