v2store

package
v0.0.0-...-bd4735d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Get              = "get"
	Create           = "create"
	Set              = "set"
	Update           = "update"
	Delete           = "delete"
	CompareAndSwap   = "compareAndSwap"
	CompareAndDelete = "compareAndDelete"
	Expire           = "expire"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Action    string      `json:"action"`
	Node      *NodeExtern `json:"node,omitempty"`
	PrevNode  *NodeExtern `json:"prevNode,omitempty"`
	EtcdIndex uint64      `json:"-"`
	Refresh   bool        `json:"refresh,omitempty"`
}

func NewEvent

func NewEvent(action string, key string, modifiedIndex, createdIndex uint64) *Event

func (*Event) Clone

func (e *Event) Clone() *Event

func (*Event) Index

func (e *Event) Index() uint64

func (*Event) IsCreated

func (e *Event) IsCreated() bool

func (*Event) SetRefresh

func (e *Event) SetRefresh()

type NodeExtern

type NodeExtern struct {
	Key           string      `json:"key,omitempty"`
	Value         *string     `json:"value,omitempty"`
	Dir           bool        `json:"dir,omitempty"`
	Expiration    *time.Time  `json:"expiration,omitempty"`
	TTL           int64       `json:"ttl,omitempty"`
	Nodes         NodeExterns `json:"nodes"`
	ModifiedIndex uint64      `json:"modifiedIndex,omitempty"`
	CreatedIndex  uint64      `json:"createdIndex,omitempty"`
}

NodeExtern is the external representation of the internal node with additional fields PrevValue is the previous value of the node TTL is time to live in second

func (*NodeExtern) Clone

func (eNode *NodeExtern) Clone() *NodeExtern

type NodeExterns

type NodeExterns []*NodeExtern

func (NodeExterns) Len

func (ns NodeExterns) Len() int

func (NodeExterns) Less

func (ns NodeExterns) Less(i, j int) bool

func (NodeExterns) Swap

func (ns NodeExterns) Swap(i, j int)

Jump to

Keyboard shortcuts

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