value

package
v0.0.0-...-1bf965b Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthValue        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowValue          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupValue = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ListenResponse_Type_name = map[int32]string{
	0: "UPDATED",
}
View Source
var ListenResponse_Type_value = map[string]int32{
	"UPDATED": 0,
}

Functions

This section is empty.

Types

type GetRequest

type GetRequest struct {
}

func (*GetRequest) Descriptor

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

func (*GetRequest) Marshal

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

func (*GetRequest) MarshalTo

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

func (*GetRequest) MarshalToSizedBuffer

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

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) Size

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

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) Unmarshal

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

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

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

func (*GetRequest) XXX_Merge

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

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

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

type GetResponse

type GetResponse struct {
	Value   []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
}

func (*GetResponse) Descriptor

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

func (*GetResponse) GetValue

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

func (*GetResponse) GetVersion

func (m *GetResponse) GetVersion() uint64

func (*GetResponse) Marshal

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

func (*GetResponse) MarshalTo

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

func (*GetResponse) MarshalToSizedBuffer

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

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) Size

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

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) Unmarshal

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

func (*GetResponse) XXX_DiscardUnknown

func (m *GetResponse) XXX_DiscardUnknown()

func (*GetResponse) XXX_Marshal

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

func (*GetResponse) XXX_Merge

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

func (*GetResponse) XXX_Size

func (m *GetResponse) XXX_Size() int

func (*GetResponse) XXX_Unmarshal

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

type ListenRequest

type ListenRequest struct {
}

func (*ListenRequest) Descriptor

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

func (*ListenRequest) Marshal

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

func (*ListenRequest) MarshalTo

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

func (*ListenRequest) MarshalToSizedBuffer

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

func (*ListenRequest) ProtoMessage

func (*ListenRequest) ProtoMessage()

func (*ListenRequest) Reset

func (m *ListenRequest) Reset()

func (*ListenRequest) Size

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

func (*ListenRequest) String

func (m *ListenRequest) String() string

func (*ListenRequest) Unmarshal

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

func (*ListenRequest) XXX_DiscardUnknown

func (m *ListenRequest) XXX_DiscardUnknown()

func (*ListenRequest) XXX_Marshal

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

func (*ListenRequest) XXX_Merge

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

func (*ListenRequest) XXX_Size

func (m *ListenRequest) XXX_Size() int

func (*ListenRequest) XXX_Unmarshal

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

type ListenResponse

type ListenResponse struct {
	Type            ListenResponse_Type `protobuf:"varint,1,opt,name=type,proto3,enum=atomix.value.service.ListenResponse_Type" json:"type,omitempty"`
	PreviousValue   []byte              `protobuf:"bytes,2,opt,name=previous_value,json=previousValue,proto3" json:"previous_value,omitempty"`
	PreviousVersion uint64              `protobuf:"varint,3,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"`
	NewValue        []byte              `protobuf:"bytes,4,opt,name=new_value,json=newValue,proto3" json:"new_value,omitempty"`
	NewVersion      uint64              `protobuf:"varint,5,opt,name=new_version,json=newVersion,proto3" json:"new_version,omitempty"`
}

func (*ListenResponse) Descriptor

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

func (*ListenResponse) GetNewValue

func (m *ListenResponse) GetNewValue() []byte

func (*ListenResponse) GetNewVersion

func (m *ListenResponse) GetNewVersion() uint64

func (*ListenResponse) GetPreviousValue

func (m *ListenResponse) GetPreviousValue() []byte

func (*ListenResponse) GetPreviousVersion

func (m *ListenResponse) GetPreviousVersion() uint64

func (*ListenResponse) GetType

func (m *ListenResponse) GetType() ListenResponse_Type

func (*ListenResponse) Marshal

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

func (*ListenResponse) MarshalTo

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

func (*ListenResponse) MarshalToSizedBuffer

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

func (*ListenResponse) ProtoMessage

func (*ListenResponse) ProtoMessage()

func (*ListenResponse) Reset

func (m *ListenResponse) Reset()

func (*ListenResponse) Size

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

func (*ListenResponse) String

func (m *ListenResponse) String() string

func (*ListenResponse) Unmarshal

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

func (*ListenResponse) XXX_DiscardUnknown

func (m *ListenResponse) XXX_DiscardUnknown()

func (*ListenResponse) XXX_Marshal

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

func (*ListenResponse) XXX_Merge

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

func (*ListenResponse) XXX_Size

func (m *ListenResponse) XXX_Size() int

func (*ListenResponse) XXX_Unmarshal

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

type ListenResponse_Type

type ListenResponse_Type int32
const (
	ListenResponse_UPDATED ListenResponse_Type = 0
)

func (ListenResponse_Type) EnumDescriptor

func (ListenResponse_Type) EnumDescriptor() ([]byte, []int)

func (ListenResponse_Type) String

func (x ListenResponse_Type) String() string

type Server

type Server struct {
	*server.SessionizedServer
}

Server is an implementation of ValueServiceServer for the value primitive

func (*Server) Close

func (s *Server) Close(ctx context.Context, request *api.CloseRequest) (*api.CloseResponse, error)

Close closes a session

func (*Server) Create

func (s *Server) Create(ctx context.Context, request *api.CreateRequest) (*api.CreateResponse, error)

Create opens a new session

func (*Server) Events

func (s *Server) Events(request *api.EventRequest, srv api.ValueService_EventsServer) error

Events listens for value change events

func (*Server) Get

func (s *Server) Get(ctx context.Context, request *api.GetRequest) (*api.GetResponse, error)

Get gets the current value and version

func (*Server) KeepAlive

func (s *Server) KeepAlive(ctx context.Context, request *api.KeepAliveRequest) (*api.KeepAliveResponse, error)

KeepAlive keeps an existing session alive

func (*Server) Set

func (s *Server) Set(ctx context.Context, request *api.SetRequest) (*api.SetResponse, error)

Set sets the value

type Service

type Service struct {
	*service.SessionizedService
	// contains filtered or unexported fields
}

Service is a state machine for a list primitive

func (*Service) Events

func (v *Service) Events(bytes []byte, stream stream.WriteStream)

Events registers a channel on which to send events

func (*Service) Get

func (v *Service) Get(bytes []byte) ([]byte, error)

Get gets the current value

func (*Service) Install

func (v *Service) Install(reader io.Reader) error

Install restores the service from a snapshot

func (*Service) Set

func (v *Service) Set(bytes []byte) ([]byte, error)

Set sets the value

func (*Service) Snapshot

func (v *Service) Snapshot(writer io.Writer) error

Snapshot takes a snapshot of the service

type SetRequest

type SetRequest struct {
	ExpectVersion uint64 `protobuf:"varint,1,opt,name=expect_version,json=expectVersion,proto3" json:"expect_version,omitempty"`
	ExpectValue   []byte `protobuf:"bytes,2,opt,name=expect_value,json=expectValue,proto3" json:"expect_value,omitempty"`
	Value         []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
}

func (*SetRequest) Descriptor

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

func (*SetRequest) GetExpectValue

func (m *SetRequest) GetExpectValue() []byte

func (*SetRequest) GetExpectVersion

func (m *SetRequest) GetExpectVersion() uint64

func (*SetRequest) GetValue

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

func (*SetRequest) Marshal

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

func (*SetRequest) MarshalTo

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

func (*SetRequest) MarshalToSizedBuffer

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

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) Reset

func (m *SetRequest) Reset()

func (*SetRequest) Size

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

func (*SetRequest) String

func (m *SetRequest) String() string

func (*SetRequest) Unmarshal

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

func (*SetRequest) XXX_DiscardUnknown

func (m *SetRequest) XXX_DiscardUnknown()

func (*SetRequest) XXX_Marshal

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

func (*SetRequest) XXX_Merge

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

func (*SetRequest) XXX_Size

func (m *SetRequest) XXX_Size() int

func (*SetRequest) XXX_Unmarshal

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

type SetResponse

type SetResponse struct {
	Version   uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Succeeded bool   `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
}

func (*SetResponse) Descriptor

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

func (*SetResponse) GetSucceeded

func (m *SetResponse) GetSucceeded() bool

func (*SetResponse) GetVersion

func (m *SetResponse) GetVersion() uint64

func (*SetResponse) Marshal

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

func (*SetResponse) MarshalTo

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

func (*SetResponse) MarshalToSizedBuffer

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

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) Reset

func (m *SetResponse) Reset()

func (*SetResponse) Size

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

func (*SetResponse) String

func (m *SetResponse) String() string

func (*SetResponse) Unmarshal

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

func (*SetResponse) XXX_DiscardUnknown

func (m *SetResponse) XXX_DiscardUnknown()

func (*SetResponse) XXX_Marshal

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

func (*SetResponse) XXX_Merge

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

func (*SetResponse) XXX_Size

func (m *SetResponse) XXX_Size() int

func (*SetResponse) XXX_Unmarshal

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

type ValueSnapshot

type ValueSnapshot struct {
	Value   []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
}

Value snapshot

func (*ValueSnapshot) Descriptor

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

func (*ValueSnapshot) GetValue

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

func (*ValueSnapshot) GetVersion

func (m *ValueSnapshot) GetVersion() uint64

func (*ValueSnapshot) Marshal

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

func (*ValueSnapshot) MarshalTo

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

func (*ValueSnapshot) MarshalToSizedBuffer

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

func (*ValueSnapshot) ProtoMessage

func (*ValueSnapshot) ProtoMessage()

func (*ValueSnapshot) Reset

func (m *ValueSnapshot) Reset()

func (*ValueSnapshot) Size

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

func (*ValueSnapshot) String

func (m *ValueSnapshot) String() string

func (*ValueSnapshot) Unmarshal

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

func (*ValueSnapshot) XXX_DiscardUnknown

func (m *ValueSnapshot) XXX_DiscardUnknown()

func (*ValueSnapshot) XXX_Marshal

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

func (*ValueSnapshot) XXX_Merge

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

func (*ValueSnapshot) XXX_Size

func (m *ValueSnapshot) XXX_Size() int

func (*ValueSnapshot) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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