value

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

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 EventsProposal

type EventsProposal interface {
	Proposal
	Request() *value.EventsRequest
	Notify(*value.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() *value.GetRequest
}

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 {
	Set() SetProposals
	Events() EventsProposals
}

type Query added in v0.9.1

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

type Service

type Service interface {
	ServiceContext
	Backup(SnapshotWriter) error
	Restore(SnapshotReader) error
	// Set sets the value
	Set(SetProposal) (*value.SetResponse, error)
	// Get gets the value
	Get(GetQuery) (*value.GetResponse, error)
	// Events listens for value change events
	Events(EventsProposal)
}

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 SetProposal

type SetProposal interface {
	Proposal
	Request() *value.SetRequest
}

type SetProposals

type SetProposals interface {
	Get(ProposalID) (SetProposal, bool)
	List() []SetProposal
}

type SnapshotReader

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

type SnapshotWriter

type SnapshotWriter interface {
	WriteState(*ValueState) error
}

type ValueState

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

func (*ValueState) Descriptor

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

func (*ValueState) GetValue

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

func (*ValueState) Marshal

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

func (*ValueState) MarshalTo

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

func (*ValueState) MarshalToSizedBuffer

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

func (*ValueState) ProtoMessage

func (*ValueState) ProtoMessage()

func (*ValueState) Reset

func (m *ValueState) Reset()

func (*ValueState) Size

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

func (*ValueState) String

func (m *ValueState) String() string

func (*ValueState) Unmarshal

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

func (*ValueState) XXX_DiscardUnknown

func (m *ValueState) XXX_DiscardUnknown()

func (*ValueState) XXX_Marshal

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

func (*ValueState) XXX_Merge

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

func (*ValueState) XXX_Size

func (m *ValueState) XXX_Size() int

func (*ValueState) XXX_Unmarshal

func (m *ValueState) XXX_Unmarshal(b []byte) 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