_map

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 = "Map"

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() *_map.ClearRequest
}

type ClearProposals

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

type EntriesQuery added in v0.9.1

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

type EventsProposal

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

type EventsProposals

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

type GetQuery added in v0.9.1

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

type MapState

type MapState struct {
	Listeners []MapStateListener `protobuf:"bytes,1,rep,name=listeners,proto3" json:"listeners"`
	Entries   []MapStateEntry    `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"`
}

func (*MapState) Descriptor

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

func (*MapState) GetEntries

func (m *MapState) GetEntries() []MapStateEntry

func (*MapState) GetListeners

func (m *MapState) GetListeners() []MapStateListener

func (*MapState) Marshal

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

func (*MapState) MarshalTo

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

func (*MapState) MarshalToSizedBuffer

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

func (*MapState) ProtoMessage

func (*MapState) ProtoMessage()

func (*MapState) Reset

func (m *MapState) Reset()

func (*MapState) Size

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

func (*MapState) String

func (m *MapState) String() string

func (*MapState) Unmarshal

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

func (*MapState) XXX_DiscardUnknown

func (m *MapState) XXX_DiscardUnknown()

func (*MapState) XXX_Marshal

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

func (*MapState) XXX_Merge

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

func (*MapState) XXX_Size

func (m *MapState) XXX_Size() int

func (*MapState) XXX_Unmarshal

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

type MapStateEntry

type MapStateEntry struct {
	Key   MapStateKey    `protobuf:"bytes,1,opt,name=key,proto3" json:"key"`
	Value *MapStateValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*MapStateEntry) Descriptor

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

func (*MapStateEntry) GetKey

func (m *MapStateEntry) GetKey() MapStateKey

func (*MapStateEntry) GetValue

func (m *MapStateEntry) GetValue() *MapStateValue

func (*MapStateEntry) Marshal

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

func (*MapStateEntry) MarshalTo

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

func (*MapStateEntry) MarshalToSizedBuffer

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

func (*MapStateEntry) ProtoMessage

func (*MapStateEntry) ProtoMessage()

func (*MapStateEntry) Reset

func (m *MapStateEntry) Reset()

func (*MapStateEntry) Size

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

func (*MapStateEntry) String

func (m *MapStateEntry) String() string

func (*MapStateEntry) Unmarshal

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

func (*MapStateEntry) XXX_DiscardUnknown

func (m *MapStateEntry) XXX_DiscardUnknown()

func (*MapStateEntry) XXX_Marshal

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

func (*MapStateEntry) XXX_Merge

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

func (*MapStateEntry) XXX_Size

func (m *MapStateEntry) XXX_Size() int

func (*MapStateEntry) XXX_Unmarshal

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

type MapStateKey

type MapStateKey struct {
	meta.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3,embedded=meta" json:"meta"`
	Key             string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
}

func (*MapStateKey) Descriptor

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

func (*MapStateKey) GetKey

func (m *MapStateKey) GetKey() string

func (*MapStateKey) Marshal

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

func (*MapStateKey) MarshalTo

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

func (*MapStateKey) MarshalToSizedBuffer

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

func (*MapStateKey) ProtoMessage

func (*MapStateKey) ProtoMessage()

func (*MapStateKey) Reset

func (m *MapStateKey) Reset()

func (*MapStateKey) Size

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

func (*MapStateKey) String

func (m *MapStateKey) String() string

func (*MapStateKey) Unmarshal

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

func (*MapStateKey) XXX_DiscardUnknown

func (m *MapStateKey) XXX_DiscardUnknown()

func (*MapStateKey) XXX_Marshal

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

func (*MapStateKey) XXX_Merge

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

func (*MapStateKey) XXX_Size

func (m *MapStateKey) XXX_Size() int

func (*MapStateKey) XXX_Unmarshal

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

type MapStateListener

type MapStateListener 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"`
}

func (*MapStateListener) Descriptor

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

func (*MapStateListener) GetKey

func (m *MapStateListener) GetKey() string

func (*MapStateListener) GetProposalID

func (m *MapStateListener) GetProposalID() ProposalID

func (*MapStateListener) Marshal

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

func (*MapStateListener) MarshalTo

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

func (*MapStateListener) MarshalToSizedBuffer

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

func (*MapStateListener) ProtoMessage

func (*MapStateListener) ProtoMessage()

func (*MapStateListener) Reset

func (m *MapStateListener) Reset()

func (*MapStateListener) Size

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

func (*MapStateListener) String

func (m *MapStateListener) String() string

func (*MapStateListener) Unmarshal

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

func (*MapStateListener) XXX_DiscardUnknown

func (m *MapStateListener) XXX_DiscardUnknown()

func (*MapStateListener) XXX_Marshal

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

func (*MapStateListener) XXX_Merge

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

func (*MapStateListener) XXX_Size

func (m *MapStateListener) XXX_Size() int

func (*MapStateListener) XXX_Unmarshal

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

type MapStateValue

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

func (*MapStateValue) Descriptor

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

func (*MapStateValue) GetExpire

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

func (*MapStateValue) GetValue

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

func (*MapStateValue) Marshal

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

func (*MapStateValue) MarshalTo

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

func (*MapStateValue) MarshalToSizedBuffer

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

func (*MapStateValue) ProtoMessage

func (*MapStateValue) ProtoMessage()

func (*MapStateValue) Reset

func (m *MapStateValue) Reset()

func (*MapStateValue) Size

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

func (*MapStateValue) String

func (m *MapStateValue) String() string

func (*MapStateValue) Unmarshal

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

func (*MapStateValue) XXX_DiscardUnknown

func (m *MapStateValue) XXX_DiscardUnknown()

func (*MapStateValue) XXX_Marshal

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

func (*MapStateValue) XXX_Merge

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

func (*MapStateValue) XXX_Size

func (m *MapStateValue) XXX_Size() int

func (*MapStateValue) XXX_Unmarshal

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

type NewServiceFunc

type NewServiceFunc func(ServiceContext) Service

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() *_map.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() *_map.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) (*_map.SizeResponse, error)
	// Put puts an entry into the map
	Put(PutProposal) (*_map.PutResponse, error)
	// Get gets the entry for a key
	Get(GetQuery) (*_map.GetResponse, error)
	// Remove removes an entry from the map
	Remove(RemoveProposal) (*_map.RemoveResponse, error)
	// Clear removes all entries from the map
	Clear(ClearProposal) (*_map.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() *_map.SizeRequest
}

type SnapshotReader

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

type SnapshotWriter

type SnapshotWriter interface {
	WriteState(*MapState) 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