indexedmap

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Overview

Code generated by atomix-go-framework. DO NOT EDIT.

Code generated by atomix-go-framework. DO NOT EDIT.

Index

Constants

View Source
const Type = "IndexedMap"

Variables

View Source
var (
	ErrInvalidLengthState        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowState          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterService

func RegisterService(node *rsm.Node)

RegisterService registers the election primitive service on the given node

Types

type ClearProposal

type ClearProposal interface {
	Proposal
	Request() *indexedmap.ClearRequest
}

type ClearProposals

type ClearProposals interface {
	Get(ProposalID) (ClearProposal, bool)
	List() []ClearProposal
}

type EntriesQuery added in v0.9.1

type EntriesQuery interface {
	Query
	Request() *indexedmap.EntriesRequest
	Notify(*indexedmap.EntriesResponse)
	Close()
}

type EventsProposal

type EventsProposal interface {
	Proposal
	Request() *indexedmap.EventsRequest
	Notify(*indexedmap.EventsResponse)
	Close()
}

type EventsProposals

type EventsProposals interface {
	Get(ProposalID) (EventsProposal, bool)
	List() []EventsProposal
}

type FirstEntryQuery added in v0.9.1

type FirstEntryQuery interface {
	Query
	Request() *indexedmap.FirstEntryRequest
}

type GetQuery added in v0.9.1

type GetQuery interface {
	Query
	Request() *indexedmap.GetRequest
}

type IndexedMapEntry

type IndexedMapEntry struct {
	IndexedMapEntryPosition `protobuf:"bytes,1,opt,name=pos,proto3,embedded=pos" json:"pos"`
	IndexedMapEntryValue    `protobuf:"bytes,2,opt,name=value,proto3,embedded=value" json:"value"`
}

func (*IndexedMapEntry) Descriptor

func (*IndexedMapEntry) Descriptor() ([]byte, []int)

func (*IndexedMapEntry) Marshal

func (m *IndexedMapEntry) Marshal() (dAtA []byte, err error)

func (*IndexedMapEntry) MarshalTo

func (m *IndexedMapEntry) MarshalTo(dAtA []byte) (int, error)

func (*IndexedMapEntry) MarshalToSizedBuffer

func (m *IndexedMapEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexedMapEntry) ProtoMessage

func (*IndexedMapEntry) ProtoMessage()

func (*IndexedMapEntry) Reset

func (m *IndexedMapEntry) Reset()

func (*IndexedMapEntry) Size

func (m *IndexedMapEntry) Size() (n int)

func (*IndexedMapEntry) String

func (m *IndexedMapEntry) String() string

func (*IndexedMapEntry) Unmarshal

func (m *IndexedMapEntry) Unmarshal(dAtA []byte) error

func (*IndexedMapEntry) XXX_DiscardUnknown

func (m *IndexedMapEntry) XXX_DiscardUnknown()

func (*IndexedMapEntry) XXX_Marshal

func (m *IndexedMapEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexedMapEntry) XXX_Merge

func (m *IndexedMapEntry) XXX_Merge(src proto.Message)

func (*IndexedMapEntry) XXX_Size

func (m *IndexedMapEntry) XXX_Size() int

func (*IndexedMapEntry) XXX_Unmarshal

func (m *IndexedMapEntry) XXX_Unmarshal(b []byte) error

type IndexedMapEntryPosition

type IndexedMapEntryPosition struct {
	Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Key   string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
}

func (*IndexedMapEntryPosition) Descriptor

func (*IndexedMapEntryPosition) Descriptor() ([]byte, []int)

func (*IndexedMapEntryPosition) GetIndex

func (m *IndexedMapEntryPosition) GetIndex() uint64

func (*IndexedMapEntryPosition) GetKey

func (m *IndexedMapEntryPosition) GetKey() string

func (*IndexedMapEntryPosition) Marshal

func (m *IndexedMapEntryPosition) Marshal() (dAtA []byte, err error)

func (*IndexedMapEntryPosition) MarshalTo

func (m *IndexedMapEntryPosition) MarshalTo(dAtA []byte) (int, error)

func (*IndexedMapEntryPosition) MarshalToSizedBuffer

func (m *IndexedMapEntryPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexedMapEntryPosition) ProtoMessage

func (*IndexedMapEntryPosition) ProtoMessage()

func (*IndexedMapEntryPosition) Reset

func (m *IndexedMapEntryPosition) Reset()

func (*IndexedMapEntryPosition) Size

func (m *IndexedMapEntryPosition) Size() (n int)

func (*IndexedMapEntryPosition) String

func (m *IndexedMapEntryPosition) String() string

func (*IndexedMapEntryPosition) Unmarshal

func (m *IndexedMapEntryPosition) Unmarshal(dAtA []byte) error

func (*IndexedMapEntryPosition) XXX_DiscardUnknown

func (m *IndexedMapEntryPosition) XXX_DiscardUnknown()

func (*IndexedMapEntryPosition) XXX_Marshal

func (m *IndexedMapEntryPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexedMapEntryPosition) XXX_Merge

func (m *IndexedMapEntryPosition) XXX_Merge(src proto.Message)

func (*IndexedMapEntryPosition) XXX_Size

func (m *IndexedMapEntryPosition) XXX_Size() int

func (*IndexedMapEntryPosition) XXX_Unmarshal

func (m *IndexedMapEntryPosition) XXX_Unmarshal(b []byte) error

type IndexedMapEntryValue

type IndexedMapEntryValue struct {
	meta.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3,embedded=meta" json:"meta"`
	Value           []byte     `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Expire          *time.Time `protobuf:"bytes,3,opt,name=expire,proto3,stdtime" json:"expire,omitempty"`
}

func (*IndexedMapEntryValue) Descriptor

func (*IndexedMapEntryValue) Descriptor() ([]byte, []int)

func (*IndexedMapEntryValue) GetExpire

func (m *IndexedMapEntryValue) GetExpire() *time.Time

func (*IndexedMapEntryValue) GetValue

func (m *IndexedMapEntryValue) GetValue() []byte

func (*IndexedMapEntryValue) Marshal

func (m *IndexedMapEntryValue) Marshal() (dAtA []byte, err error)

func (*IndexedMapEntryValue) MarshalTo

func (m *IndexedMapEntryValue) MarshalTo(dAtA []byte) (int, error)

func (*IndexedMapEntryValue) MarshalToSizedBuffer

func (m *IndexedMapEntryValue) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexedMapEntryValue) ProtoMessage

func (*IndexedMapEntryValue) ProtoMessage()

func (*IndexedMapEntryValue) Reset

func (m *IndexedMapEntryValue) Reset()

func (*IndexedMapEntryValue) Size

func (m *IndexedMapEntryValue) Size() (n int)

func (*IndexedMapEntryValue) String

func (m *IndexedMapEntryValue) String() string

func (*IndexedMapEntryValue) Unmarshal

func (m *IndexedMapEntryValue) Unmarshal(dAtA []byte) error

func (*IndexedMapEntryValue) XXX_DiscardUnknown

func (m *IndexedMapEntryValue) XXX_DiscardUnknown()

func (*IndexedMapEntryValue) XXX_Marshal

func (m *IndexedMapEntryValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexedMapEntryValue) XXX_Merge

func (m *IndexedMapEntryValue) XXX_Merge(src proto.Message)

func (*IndexedMapEntryValue) XXX_Size

func (m *IndexedMapEntryValue) XXX_Size() int

func (*IndexedMapEntryValue) XXX_Unmarshal

func (m *IndexedMapEntryValue) XXX_Unmarshal(b []byte) error

type IndexedMapState

type IndexedMapState struct {
	Listeners []IndexedMapStateListener `protobuf:"bytes,1,rep,name=listeners,proto3" json:"listeners"`
	Entries   []IndexedMapEntry         `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"`
}

func (*IndexedMapState) Descriptor

func (*IndexedMapState) Descriptor() ([]byte, []int)

func (*IndexedMapState) GetEntries

func (m *IndexedMapState) GetEntries() []IndexedMapEntry

func (*IndexedMapState) GetListeners

func (m *IndexedMapState) GetListeners() []IndexedMapStateListener

func (*IndexedMapState) Marshal

func (m *IndexedMapState) Marshal() (dAtA []byte, err error)

func (*IndexedMapState) MarshalTo

func (m *IndexedMapState) MarshalTo(dAtA []byte) (int, error)

func (*IndexedMapState) MarshalToSizedBuffer

func (m *IndexedMapState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexedMapState) ProtoMessage

func (*IndexedMapState) ProtoMessage()

func (*IndexedMapState) Reset

func (m *IndexedMapState) Reset()

func (*IndexedMapState) Size

func (m *IndexedMapState) Size() (n int)

func (*IndexedMapState) String

func (m *IndexedMapState) String() string

func (*IndexedMapState) Unmarshal

func (m *IndexedMapState) Unmarshal(dAtA []byte) error

func (*IndexedMapState) XXX_DiscardUnknown

func (m *IndexedMapState) XXX_DiscardUnknown()

func (*IndexedMapState) XXX_Marshal

func (m *IndexedMapState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexedMapState) XXX_Merge

func (m *IndexedMapState) XXX_Merge(src proto.Message)

func (*IndexedMapState) XXX_Size

func (m *IndexedMapState) XXX_Size() int

func (*IndexedMapState) XXX_Unmarshal

func (m *IndexedMapState) XXX_Unmarshal(b []byte) error

type IndexedMapStateListener

type IndexedMapStateListener struct {
	ProposalID ProposalID `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3,casttype=ProposalID" json:"proposal_id,omitempty"`
	Key        string     `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Index      uint64     `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
}

func (*IndexedMapStateListener) Descriptor

func (*IndexedMapStateListener) Descriptor() ([]byte, []int)

func (*IndexedMapStateListener) GetIndex

func (m *IndexedMapStateListener) GetIndex() uint64

func (*IndexedMapStateListener) GetKey

func (m *IndexedMapStateListener) GetKey() string

func (*IndexedMapStateListener) GetProposalID

func (m *IndexedMapStateListener) GetProposalID() ProposalID

func (*IndexedMapStateListener) Marshal

func (m *IndexedMapStateListener) Marshal() (dAtA []byte, err error)

func (*IndexedMapStateListener) MarshalTo

func (m *IndexedMapStateListener) MarshalTo(dAtA []byte) (int, error)

func (*IndexedMapStateListener) MarshalToSizedBuffer

func (m *IndexedMapStateListener) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IndexedMapStateListener) ProtoMessage

func (*IndexedMapStateListener) ProtoMessage()

func (*IndexedMapStateListener) Reset

func (m *IndexedMapStateListener) Reset()

func (*IndexedMapStateListener) Size

func (m *IndexedMapStateListener) Size() (n int)

func (*IndexedMapStateListener) String

func (m *IndexedMapStateListener) String() string

func (*IndexedMapStateListener) Unmarshal

func (m *IndexedMapStateListener) Unmarshal(dAtA []byte) error

func (*IndexedMapStateListener) XXX_DiscardUnknown

func (m *IndexedMapStateListener) XXX_DiscardUnknown()

func (*IndexedMapStateListener) XXX_Marshal

func (m *IndexedMapStateListener) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexedMapStateListener) XXX_Merge

func (m *IndexedMapStateListener) XXX_Merge(src proto.Message)

func (*IndexedMapStateListener) XXX_Size

func (m *IndexedMapStateListener) XXX_Size() int

func (*IndexedMapStateListener) XXX_Unmarshal

func (m *IndexedMapStateListener) XXX_Unmarshal(b []byte) error

type LastEntryQuery added in v0.9.1

type LastEntryQuery interface {
	Query
	Request() *indexedmap.LastEntryRequest
}

type LinkedMapEntryValue

type LinkedMapEntryValue struct {
	*IndexedMapEntry
	Prev *LinkedMapEntryValue
	Next *LinkedMapEntryValue
}

LinkedMapEntryValue is a doubly linked MapEntryValue

type NewServiceFunc

type NewServiceFunc func(ServiceContext) Service

type NextEntryQuery added in v0.9.1

type NextEntryQuery interface {
	Query
	Request() *indexedmap.NextEntryRequest
}

type PrevEntryQuery added in v0.9.1

type PrevEntryQuery interface {
	Query
	Request() *indexedmap.PrevEntryRequest
}

type Proposal

type Proposal interface {
	fmt.Stringer
	ID() ProposalID
	Session() Session
	State() ProposalState
	Watch(func(ProposalState)) Watcher
}

type ProposalID

type ProposalID uint64

type ProposalState added in v0.9.1

type ProposalState int
const (
	ProposalComplete ProposalState = iota
	ProposalOpen
)

type Proposals

type Proposals interface {
	Put() PutProposals
	Remove() RemoveProposals
	Clear() ClearProposals
	Events() EventsProposals
}

type PutProposal

type PutProposal interface {
	Proposal
	Request() *indexedmap.PutRequest
}

type PutProposals

type PutProposals interface {
	Get(ProposalID) (PutProposal, bool)
	List() []PutProposal
}

type Query added in v0.9.1

type Query interface {
	fmt.Stringer
	Session() Session
}

type RemoveProposal

type RemoveProposal interface {
	Proposal
	Request() *indexedmap.RemoveRequest
}

type RemoveProposals

type RemoveProposals interface {
	Get(ProposalID) (RemoveProposal, bool)
	List() []RemoveProposal
}

type Service

type Service interface {
	ServiceContext
	Backup(SnapshotWriter) error
	Restore(SnapshotReader) error
	// Size returns the size of the map
	Size(SizeQuery) (*indexedmap.SizeResponse, error)
	// Put puts an entry into the map
	Put(PutProposal) (*indexedmap.PutResponse, error)
	// Get gets the entry for a key
	Get(GetQuery) (*indexedmap.GetResponse, error)
	// FirstEntry gets the first entry in the map
	FirstEntry(FirstEntryQuery) (*indexedmap.FirstEntryResponse, error)
	// LastEntry gets the last entry in the map
	LastEntry(LastEntryQuery) (*indexedmap.LastEntryResponse, error)
	// PrevEntry gets the previous entry in the map
	PrevEntry(PrevEntryQuery) (*indexedmap.PrevEntryResponse, error)
	// NextEntry gets the next entry in the map
	NextEntry(NextEntryQuery) (*indexedmap.NextEntryResponse, error)
	// Remove removes an entry from the map
	Remove(RemoveProposal) (*indexedmap.RemoveResponse, error)
	// Clear removes all entries from the map
	Clear(ClearProposal) (*indexedmap.ClearResponse, error)
	// Events listens for change events
	Events(EventsProposal)
	// Entries lists all entries in the map
	Entries(EntriesQuery)
}

type ServiceAdaptor

type ServiceAdaptor struct {
	rsm.ServiceContext
	// contains filtered or unexported fields
}

func (*ServiceAdaptor) Backup

func (s *ServiceAdaptor) Backup(writer io.Writer) error

func (*ServiceAdaptor) ExecuteCommand added in v0.9.1

func (s *ServiceAdaptor) ExecuteCommand(command rsm.Command)

func (*ServiceAdaptor) ExecuteQuery added in v0.9.1

func (s *ServiceAdaptor) ExecuteQuery(query rsm.Query)

func (*ServiceAdaptor) Restore

func (s *ServiceAdaptor) Restore(reader io.Reader) error

type ServiceContext

type ServiceContext interface {
	Scheduler() rsm.Scheduler
	Sessions() Sessions
	Proposals() Proposals
}

type Session

type Session interface {
	ID() SessionID
	State() SessionState
	Watch(func(SessionState)) Watcher
	Proposals() Proposals
}

type SessionID

type SessionID uint64

type SessionState

type SessionState int
const (
	SessionClosed SessionState = iota
	SessionOpen
)

type Sessions

type Sessions interface {
	Get(SessionID) (Session, bool)
	List() []Session
}

type SizeQuery added in v0.9.1

type SizeQuery interface {
	Query
	Request() *indexedmap.SizeRequest
}

type SnapshotReader

type SnapshotReader interface {
	ReadState() (*IndexedMapState, error)
}

type SnapshotWriter

type SnapshotWriter interface {
	WriteState(*IndexedMapState) error
}

type Watcher

type Watcher interface {
	Cancel()
}

Jump to

Keyboard shortcuts

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