set

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: Apache-2.0 Imports: 15 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 = "Set"

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 AddProposal

type AddProposal interface {
	Proposal
	Request() *set.AddRequest
	Reply(*set.AddResponse) error
	// contains filtered or unexported methods
}

type AddProposals

type AddProposals interface {
	Get(ProposalID) (AddProposal, bool)
	List() []AddProposal
	// contains filtered or unexported methods
}

type ClearProposal

type ClearProposal interface {
	Proposal
	Request() *set.ClearRequest
	Reply(*set.ClearResponse) error
	// contains filtered or unexported methods
}

type ClearProposals

type ClearProposals interface {
	Get(ProposalID) (ClearProposal, bool)
	List() []ClearProposal
	// contains filtered or unexported methods
}

type ContainsProposal

type ContainsProposal interface {
	Proposal
	Request() *set.ContainsRequest
	Reply(*set.ContainsResponse) error
	// contains filtered or unexported methods
}

type ContainsProposals

type ContainsProposals interface {
	Get(ProposalID) (ContainsProposal, bool)
	List() []ContainsProposal
	// contains filtered or unexported methods
}

type ElementsProposal

type ElementsProposal interface {
	Proposal
	Request() *set.ElementsRequest
	Notify(*set.ElementsResponse) error
	Close() error
}

type ElementsProposals

type ElementsProposals interface {
	Get(ProposalID) (ElementsProposal, bool)
	List() []ElementsProposal
	// contains filtered or unexported methods
}

type EventsProposal

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

type EventsProposals

type EventsProposals interface {
	Get(ProposalID) (EventsProposal, bool)
	List() []EventsProposal
	// contains filtered or unexported methods
}

type NewServiceFunc

type NewServiceFunc func(ServiceContext) Service

type Proposal

type Proposal interface {
	fmt.Stringer
	ID() ProposalID
	Session() Session
}

type ProposalID

type ProposalID uint64

type Proposals

type Proposals interface {
	Size() SizeProposals
	Contains() ContainsProposals
	Add() AddProposals
	Remove() RemoveProposals
	Clear() ClearProposals
	Events() EventsProposals
	Elements() ElementsProposals
}

type RemoveProposal

type RemoveProposal interface {
	Proposal
	Request() *set.RemoveRequest
	Reply(*set.RemoveResponse) error
	// contains filtered or unexported methods
}

type RemoveProposals

type RemoveProposals interface {
	Get(ProposalID) (RemoveProposal, bool)
	List() []RemoveProposal
	// contains filtered or unexported methods
}

type Service

type Service interface {
	ServiceContext
	Backup(SnapshotWriter) error
	Restore(SnapshotReader) error
	// Size gets the number of elements in the set
	Size(SizeProposal) error
	// Contains returns whether the set contains a value
	Contains(ContainsProposal) error
	// Add adds a value to the set
	Add(AddProposal) error
	// Remove removes a value from the set
	Remove(RemoveProposal) error
	// Clear removes all values from the set
	Clear(ClearProposal) error
	// Events listens for set change events
	Events(EventsProposal) error
	// Elements lists all elements in the set
	Elements(ElementsProposal) error
}

type ServiceAdaptor

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

func (*ServiceAdaptor) Backup

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

func (*ServiceAdaptor) Restore

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

func (*ServiceAdaptor) SessionClosed

func (s *ServiceAdaptor) SessionClosed(session rsm.Session)

func (*ServiceAdaptor) SessionExpired

func (s *ServiceAdaptor) SessionExpired(session rsm.Session)

func (*ServiceAdaptor) SessionOpen

func (s *ServiceAdaptor) SessionOpen(rsmSession rsm.Session)

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
	// contains filtered or unexported methods
}

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
	// contains filtered or unexported methods
}

type SetState

type SetState struct {
	Values []SetValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values"`
}

func (*SetState) Descriptor

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

func (*SetState) GetValues

func (m *SetState) GetValues() []SetValue

func (*SetState) Marshal

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

func (*SetState) MarshalTo

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

func (*SetState) MarshalToSizedBuffer

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

func (*SetState) ProtoMessage

func (*SetState) ProtoMessage()

func (*SetState) Reset

func (m *SetState) Reset()

func (*SetState) Size

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

func (*SetState) String

func (m *SetState) String() string

func (*SetState) Unmarshal

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

func (*SetState) XXX_DiscardUnknown

func (m *SetState) XXX_DiscardUnknown()

func (*SetState) XXX_Marshal

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

func (*SetState) XXX_Merge

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

func (*SetState) XXX_Size

func (m *SetState) XXX_Size() int

func (*SetState) XXX_Unmarshal

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

type SetValue

type SetValue struct {
	meta.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3,embedded=meta" json:"meta"`
	Value           string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*SetValue) Descriptor

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

func (*SetValue) GetValue

func (m *SetValue) GetValue() string

func (*SetValue) Marshal

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

func (*SetValue) MarshalTo

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

func (*SetValue) MarshalToSizedBuffer

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

func (*SetValue) ProtoMessage

func (*SetValue) ProtoMessage()

func (*SetValue) Reset

func (m *SetValue) Reset()

func (*SetValue) Size

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

func (*SetValue) String

func (m *SetValue) String() string

func (*SetValue) Unmarshal

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

func (*SetValue) XXX_DiscardUnknown

func (m *SetValue) XXX_DiscardUnknown()

func (*SetValue) XXX_Marshal

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

func (*SetValue) XXX_Merge

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

func (*SetValue) XXX_Size

func (m *SetValue) XXX_Size() int

func (*SetValue) XXX_Unmarshal

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

type SizeProposal

type SizeProposal interface {
	Proposal
	Request() *set.SizeRequest
	Reply(*set.SizeResponse) error
	// contains filtered or unexported methods
}

type SizeProposals

type SizeProposals interface {
	Get(ProposalID) (SizeProposal, bool)
	List() []SizeProposal
	// contains filtered or unexported methods
}

type SnapshotReader

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

type SnapshotWriter

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