set

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: 14 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
}

type AddProposals

type AddProposals interface {
	Get(ProposalID) (AddProposal, bool)
	List() []AddProposal
}

type ClearProposal

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

type ClearProposals

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

type ContainsQuery added in v0.9.1

type ContainsQuery interface {
	Query
	Request() *set.ContainsRequest
}

type ElementsQuery added in v0.9.1

type ElementsQuery interface {
	Query
	Request() *set.ElementsRequest
	Notify(*set.ElementsResponse)
	Close()
}

type EventsProposal

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

type EventsProposals

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

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 {
	Add() AddProposals
	Remove() RemoveProposals
	Clear() ClearProposals
	Events() EventsProposals
}

type Query added in v0.9.1

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

type RemoveProposal

type RemoveProposal interface {
	Proposal
	Request() *set.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 gets the number of elements in the set
	Size(SizeQuery) (*set.SizeResponse, error)
	// Contains returns whether the set contains a value
	Contains(ContainsQuery) (*set.ContainsResponse, error)
	// Add adds a value to the set
	Add(AddProposal) (*set.AddResponse, error)
	// Remove removes a value from the set
	Remove(RemoveProposal) (*set.RemoveResponse, error)
	// Clear removes all values from the set
	Clear(ClearProposal) (*set.ClearResponse, error)
	// Events listens for set change events
	Events(EventsProposal)
	// Elements lists all elements in the set
	Elements(ElementsQuery)
}

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 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 SizeQuery added in v0.9.1

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

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