kubernetes/vendor/go.etcd.io/etcd/client/v3/concurrency/stm.go

type STM

type Isolation

const SerializableSnapshot

const Serializable

const RepeatableReads

const ReadCommitted

type stmError

type stmOptions

type stmOption

// WithIsolation specifies the transaction isolation level.
func WithIsolation(lvl Isolation) stmOption {}

// WithAbortContext specifies the context for permanently aborting the transaction.
func WithAbortContext(ctx context.Context) stmOption {}

// WithPrefetch is a hint to prefetch a list of keys before trying to apply.
// If an STM transaction will unconditionally fetch a set of keys, prefetching
// those keys will save the round-trip cost from requesting each key one by one
// with Get().
func WithPrefetch(keys ...string) stmOption {}

// NewSTM initiates a new STM instance, using serializable snapshot isolation by default.
func NewSTM(c *v3.Client, apply func(STM) error, so ...stmOption) (*v3.TxnResponse, error) {}

func mkSTM(c *v3.Client, opts *stmOptions) STM {}

type stmResponse

func runSTM(s STM, apply func(STM) error) (*v3.TxnResponse, error) {}

type stm

type stmPut

type readSet

func (rs readSet) add(keys []string, txnresp *v3.TxnResponse) {}

// first returns the store revision from the first fetch
func (rs readSet) first() int64 {}

// cmps guards the txn from updates to read set
func (rs readSet) cmps() []v3.Cmp {}

type writeSet

func (ws writeSet) get(keys ...string) *stmPut {}

// cmps returns a cmp list testing no writes have happened past rev
func (ws writeSet) cmps(rev int64) []v3.Cmp {}

// puts is the list of ops for all pending writes
func (ws writeSet) puts() []v3.Op {}

func (s *stm) Get(keys ...string) string {}

func (s *stm) Put(key, val string, opts ...v3.OpOption) {}

func (s *stm) Del(key string) {}

func (s *stm) Rev(key string) int64 {}

func (s *stm) commit() *v3.TxnResponse {}

func (s *stm) fetch(keys ...string) *v3.GetResponse {}

func (s *stm) reset() {}

type stmSerializable

func (s *stmSerializable) Get(keys ...string) string {}

func (s *stmSerializable) Rev(key string) int64 {}

func (s *stmSerializable) gets() ([]string, []v3.Op) {}

func (s *stmSerializable) commit() *v3.TxnResponse {}

func isKeyCurrent(k string, r *v3.GetResponse) v3.Cmp {}

func respToValue(resp *v3.GetResponse) string {}

// NewSTMRepeatable is deprecated.
func NewSTMRepeatable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) {}

// NewSTMSerializable is deprecated.
func NewSTMSerializable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) {}

// NewSTMReadCommitted is deprecated.
func NewSTMReadCommitted(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) {}