Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterPrimitive(node *atomix.Node)
- type IsLockedRequest
- func (*IsLockedRequest) Descriptor() ([]byte, []int)
- func (m *IsLockedRequest) GetIndex() int64
- func (m *IsLockedRequest) Marshal() (dAtA []byte, err error)
- func (m *IsLockedRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *IsLockedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*IsLockedRequest) ProtoMessage()
- func (m *IsLockedRequest) Reset()
- func (m *IsLockedRequest) Size() (n int)
- func (m *IsLockedRequest) String() string
- func (m *IsLockedRequest) Unmarshal(dAtA []byte) error
- func (m *IsLockedRequest) XXX_DiscardUnknown()
- func (m *IsLockedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *IsLockedRequest) XXX_Merge(src proto.Message)
- func (m *IsLockedRequest) XXX_Size() int
- func (m *IsLockedRequest) XXX_Unmarshal(b []byte) error
- type IsLockedResponse
- func (*IsLockedResponse) Descriptor() ([]byte, []int)
- func (m *IsLockedResponse) GetLocked() bool
- func (m *IsLockedResponse) Marshal() (dAtA []byte, err error)
- func (m *IsLockedResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *IsLockedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*IsLockedResponse) ProtoMessage()
- func (m *IsLockedResponse) Reset()
- func (m *IsLockedResponse) Size() (n int)
- func (m *IsLockedResponse) String() string
- func (m *IsLockedResponse) Unmarshal(dAtA []byte) error
- func (m *IsLockedResponse) XXX_DiscardUnknown()
- func (m *IsLockedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *IsLockedResponse) XXX_Merge(src proto.Message)
- func (m *IsLockedResponse) XXX_Size() int
- func (m *IsLockedResponse) XXX_Unmarshal(b []byte) error
- type LockCall
- func (*LockCall) Descriptor() ([]byte, []int)
- func (m *LockCall) GetExpire() *time.Time
- func (m *LockCall) GetIndex() int64
- func (m *LockCall) GetSessionId() int64
- func (m *LockCall) Marshal() (dAtA []byte, err error)
- func (m *LockCall) MarshalTo(dAtA []byte) (int, error)
- func (m *LockCall) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LockCall) ProtoMessage()
- func (m *LockCall) Reset()
- func (m *LockCall) Size() (n int)
- func (m *LockCall) String() string
- func (m *LockCall) Unmarshal(dAtA []byte) error
- func (m *LockCall) XXX_DiscardUnknown()
- func (m *LockCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LockCall) XXX_Merge(src proto.Message)
- func (m *LockCall) XXX_Size() int
- func (m *LockCall) XXX_Unmarshal(b []byte) error
- type LockRequest
- func (*LockRequest) Descriptor() ([]byte, []int)
- func (m *LockRequest) GetTimeout() *time.Duration
- func (m *LockRequest) Marshal() (dAtA []byte, err error)
- func (m *LockRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *LockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LockRequest) ProtoMessage()
- func (m *LockRequest) Reset()
- func (m *LockRequest) Size() (n int)
- func (m *LockRequest) String() string
- func (m *LockRequest) Unmarshal(dAtA []byte) error
- func (m *LockRequest) XXX_DiscardUnknown()
- func (m *LockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LockRequest) XXX_Merge(src proto.Message)
- func (m *LockRequest) XXX_Size() int
- func (m *LockRequest) XXX_Unmarshal(b []byte) error
- type LockResponse
- func (*LockResponse) Descriptor() ([]byte, []int)
- func (m *LockResponse) GetAcquired() bool
- func (m *LockResponse) GetIndex() int64
- func (m *LockResponse) Marshal() (dAtA []byte, err error)
- func (m *LockResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *LockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LockResponse) ProtoMessage()
- func (m *LockResponse) Reset()
- func (m *LockResponse) Size() (n int)
- func (m *LockResponse) String() string
- func (m *LockResponse) Unmarshal(dAtA []byte) error
- func (m *LockResponse) XXX_DiscardUnknown()
- func (m *LockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LockResponse) XXX_Merge(src proto.Message)
- func (m *LockResponse) XXX_Size() int
- func (m *LockResponse) XXX_Unmarshal(b []byte) error
- type LockSnapshot
- func (*LockSnapshot) Descriptor() ([]byte, []int)
- func (m *LockSnapshot) GetLock() *LockCall
- func (m *LockSnapshot) GetQueue() []*LockCall
- func (m *LockSnapshot) Marshal() (dAtA []byte, err error)
- func (m *LockSnapshot) MarshalTo(dAtA []byte) (int, error)
- func (m *LockSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LockSnapshot) ProtoMessage()
- func (m *LockSnapshot) Reset()
- func (m *LockSnapshot) Size() (n int)
- func (m *LockSnapshot) String() string
- func (m *LockSnapshot) Unmarshal(dAtA []byte) error
- func (m *LockSnapshot) XXX_DiscardUnknown()
- func (m *LockSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LockSnapshot) XXX_Merge(src proto.Message)
- func (m *LockSnapshot) XXX_Size() int
- func (m *LockSnapshot) XXX_Unmarshal(b []byte) error
- type Primitive
- type Server
- func (s *Server) Close(ctx context.Context, request *api.CloseRequest) (*api.CloseResponse, error)
- func (s *Server) Create(ctx context.Context, request *api.CreateRequest) (*api.CreateResponse, error)
- func (s *Server) IsLocked(ctx context.Context, request *api.IsLockedRequest) (*api.IsLockedResponse, error)
- func (s *Server) Lock(ctx context.Context, request *api.LockRequest) (*api.LockResponse, error)
- func (s *Server) Unlock(ctx context.Context, request *api.UnlockRequest) (*api.UnlockResponse, error)
- type Service
- func (l *Service) Backup(writer io.Writer) error
- func (l *Service) IsLocked(bytes []byte) ([]byte, error)
- func (l *Service) Lock(bytes []byte, stream primitive.Stream)
- func (l *Service) Restore(reader io.Reader) error
- func (l *Service) SessionClosed(session primitive.Session)
- func (l *Service) SessionExpired(session primitive.Session)
- func (l *Service) Unlock(bytes []byte) ([]byte, error)
- type UnlockRequest
- func (*UnlockRequest) Descriptor() ([]byte, []int)
- func (m *UnlockRequest) GetIndex() int64
- func (m *UnlockRequest) Marshal() (dAtA []byte, err error)
- func (m *UnlockRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *UnlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UnlockRequest) ProtoMessage()
- func (m *UnlockRequest) Reset()
- func (m *UnlockRequest) Size() (n int)
- func (m *UnlockRequest) String() string
- func (m *UnlockRequest) Unmarshal(dAtA []byte) error
- func (m *UnlockRequest) XXX_DiscardUnknown()
- func (m *UnlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UnlockRequest) XXX_Merge(src proto.Message)
- func (m *UnlockRequest) XXX_Size() int
- func (m *UnlockRequest) XXX_Unmarshal(b []byte) error
- type UnlockResponse
- func (*UnlockResponse) Descriptor() ([]byte, []int)
- func (m *UnlockResponse) GetSucceeded() bool
- func (m *UnlockResponse) Marshal() (dAtA []byte, err error)
- func (m *UnlockResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *UnlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UnlockResponse) ProtoMessage()
- func (m *UnlockResponse) Reset()
- func (m *UnlockResponse) Size() (n int)
- func (m *UnlockResponse) String() string
- func (m *UnlockResponse) Unmarshal(dAtA []byte) error
- func (m *UnlockResponse) XXX_DiscardUnknown()
- func (m *UnlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UnlockResponse) XXX_Merge(src proto.Message)
- func (m *UnlockResponse) XXX_Size() int
- func (m *UnlockResponse) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const Type = primitiveapi.PrimitiveType_LOCK
Type is the lock primitive type
Variables ¶
Functions ¶
func RegisterPrimitive ¶
RegisterPrimitive registers the primitive on the given node
Types ¶
type IsLockedRequest ¶
type IsLockedRequest struct {
Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
}
func (*IsLockedRequest) Descriptor ¶
func (*IsLockedRequest) Descriptor() ([]byte, []int)
func (*IsLockedRequest) GetIndex ¶
func (m *IsLockedRequest) GetIndex() int64
func (*IsLockedRequest) Marshal ¶
func (m *IsLockedRequest) Marshal() (dAtA []byte, err error)
func (*IsLockedRequest) MarshalToSizedBuffer ¶
func (m *IsLockedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*IsLockedRequest) ProtoMessage ¶
func (*IsLockedRequest) ProtoMessage()
func (*IsLockedRequest) Reset ¶
func (m *IsLockedRequest) Reset()
func (*IsLockedRequest) Size ¶
func (m *IsLockedRequest) Size() (n int)
func (*IsLockedRequest) String ¶
func (m *IsLockedRequest) String() string
func (*IsLockedRequest) Unmarshal ¶
func (m *IsLockedRequest) Unmarshal(dAtA []byte) error
func (*IsLockedRequest) XXX_DiscardUnknown ¶
func (m *IsLockedRequest) XXX_DiscardUnknown()
func (*IsLockedRequest) XXX_Marshal ¶
func (m *IsLockedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*IsLockedRequest) XXX_Merge ¶
func (m *IsLockedRequest) XXX_Merge(src proto.Message)
func (*IsLockedRequest) XXX_Size ¶
func (m *IsLockedRequest) XXX_Size() int
func (*IsLockedRequest) XXX_Unmarshal ¶
func (m *IsLockedRequest) XXX_Unmarshal(b []byte) error
type IsLockedResponse ¶
type IsLockedResponse struct {
Locked bool `protobuf:"varint,1,opt,name=locked,proto3" json:"locked,omitempty"`
}
func (*IsLockedResponse) Descriptor ¶
func (*IsLockedResponse) Descriptor() ([]byte, []int)
func (*IsLockedResponse) GetLocked ¶
func (m *IsLockedResponse) GetLocked() bool
func (*IsLockedResponse) Marshal ¶
func (m *IsLockedResponse) Marshal() (dAtA []byte, err error)
func (*IsLockedResponse) MarshalToSizedBuffer ¶
func (m *IsLockedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*IsLockedResponse) ProtoMessage ¶
func (*IsLockedResponse) ProtoMessage()
func (*IsLockedResponse) Reset ¶
func (m *IsLockedResponse) Reset()
func (*IsLockedResponse) Size ¶
func (m *IsLockedResponse) Size() (n int)
func (*IsLockedResponse) String ¶
func (m *IsLockedResponse) String() string
func (*IsLockedResponse) Unmarshal ¶
func (m *IsLockedResponse) Unmarshal(dAtA []byte) error
func (*IsLockedResponse) XXX_DiscardUnknown ¶
func (m *IsLockedResponse) XXX_DiscardUnknown()
func (*IsLockedResponse) XXX_Marshal ¶
func (m *IsLockedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*IsLockedResponse) XXX_Merge ¶
func (m *IsLockedResponse) XXX_Merge(src proto.Message)
func (*IsLockedResponse) XXX_Size ¶
func (m *IsLockedResponse) XXX_Size() int
func (*IsLockedResponse) XXX_Unmarshal ¶
func (m *IsLockedResponse) XXX_Unmarshal(b []byte) error
type LockCall ¶
type LockCall struct { Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` SessionId int64 `protobuf:"varint,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` Expire *time.Time `protobuf:"bytes,3,opt,name=expire,proto3,stdtime" json:"expire,omitempty"` }
Lock call
func (*LockCall) Descriptor ¶
func (*LockCall) GetSessionId ¶
func (*LockCall) MarshalToSizedBuffer ¶
func (*LockCall) ProtoMessage ¶
func (*LockCall) ProtoMessage()
func (*LockCall) XXX_DiscardUnknown ¶
func (m *LockCall) XXX_DiscardUnknown()
func (*LockCall) XXX_Marshal ¶
func (*LockCall) XXX_Unmarshal ¶
type LockRequest ¶
type LockRequest struct {
Timeout *time.Duration `protobuf:"bytes,1,opt,name=timeout,proto3,stdduration" json:"timeout,omitempty"`
}
func (*LockRequest) Descriptor ¶
func (*LockRequest) Descriptor() ([]byte, []int)
func (*LockRequest) GetTimeout ¶
func (m *LockRequest) GetTimeout() *time.Duration
func (*LockRequest) Marshal ¶
func (m *LockRequest) Marshal() (dAtA []byte, err error)
func (*LockRequest) MarshalToSizedBuffer ¶
func (m *LockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LockRequest) ProtoMessage ¶
func (*LockRequest) ProtoMessage()
func (*LockRequest) Reset ¶
func (m *LockRequest) Reset()
func (*LockRequest) Size ¶
func (m *LockRequest) Size() (n int)
func (*LockRequest) String ¶
func (m *LockRequest) String() string
func (*LockRequest) Unmarshal ¶
func (m *LockRequest) Unmarshal(dAtA []byte) error
func (*LockRequest) XXX_DiscardUnknown ¶
func (m *LockRequest) XXX_DiscardUnknown()
func (*LockRequest) XXX_Marshal ¶
func (m *LockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LockRequest) XXX_Merge ¶
func (m *LockRequest) XXX_Merge(src proto.Message)
func (*LockRequest) XXX_Size ¶
func (m *LockRequest) XXX_Size() int
func (*LockRequest) XXX_Unmarshal ¶
func (m *LockRequest) XXX_Unmarshal(b []byte) error
type LockResponse ¶
type LockResponse struct { Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Acquired bool `protobuf:"varint,2,opt,name=acquired,proto3" json:"acquired,omitempty"` }
func (*LockResponse) Descriptor ¶
func (*LockResponse) Descriptor() ([]byte, []int)
func (*LockResponse) GetAcquired ¶
func (m *LockResponse) GetAcquired() bool
func (*LockResponse) GetIndex ¶
func (m *LockResponse) GetIndex() int64
func (*LockResponse) Marshal ¶
func (m *LockResponse) Marshal() (dAtA []byte, err error)
func (*LockResponse) MarshalToSizedBuffer ¶
func (m *LockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LockResponse) ProtoMessage ¶
func (*LockResponse) ProtoMessage()
func (*LockResponse) Reset ¶
func (m *LockResponse) Reset()
func (*LockResponse) Size ¶
func (m *LockResponse) Size() (n int)
func (*LockResponse) String ¶
func (m *LockResponse) String() string
func (*LockResponse) Unmarshal ¶
func (m *LockResponse) Unmarshal(dAtA []byte) error
func (*LockResponse) XXX_DiscardUnknown ¶
func (m *LockResponse) XXX_DiscardUnknown()
func (*LockResponse) XXX_Marshal ¶
func (m *LockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LockResponse) XXX_Merge ¶
func (m *LockResponse) XXX_Merge(src proto.Message)
func (*LockResponse) XXX_Size ¶
func (m *LockResponse) XXX_Size() int
func (*LockResponse) XXX_Unmarshal ¶
func (m *LockResponse) XXX_Unmarshal(b []byte) error
type LockSnapshot ¶
type LockSnapshot struct { Lock *LockCall `protobuf:"bytes,1,opt,name=lock,proto3" json:"lock,omitempty"` Queue []*LockCall `protobuf:"bytes,2,rep,name=queue,proto3" json:"queue,omitempty"` }
Lock snapshot
func (*LockSnapshot) Descriptor ¶
func (*LockSnapshot) Descriptor() ([]byte, []int)
func (*LockSnapshot) GetLock ¶
func (m *LockSnapshot) GetLock() *LockCall
func (*LockSnapshot) GetQueue ¶
func (m *LockSnapshot) GetQueue() []*LockCall
func (*LockSnapshot) Marshal ¶
func (m *LockSnapshot) Marshal() (dAtA []byte, err error)
func (*LockSnapshot) MarshalToSizedBuffer ¶
func (m *LockSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LockSnapshot) ProtoMessage ¶
func (*LockSnapshot) ProtoMessage()
func (*LockSnapshot) Reset ¶
func (m *LockSnapshot) Reset()
func (*LockSnapshot) Size ¶
func (m *LockSnapshot) Size() (n int)
func (*LockSnapshot) String ¶
func (m *LockSnapshot) String() string
func (*LockSnapshot) Unmarshal ¶
func (m *LockSnapshot) Unmarshal(dAtA []byte) error
func (*LockSnapshot) XXX_DiscardUnknown ¶
func (m *LockSnapshot) XXX_DiscardUnknown()
func (*LockSnapshot) XXX_Marshal ¶
func (m *LockSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LockSnapshot) XXX_Merge ¶
func (m *LockSnapshot) XXX_Merge(src proto.Message)
func (*LockSnapshot) XXX_Size ¶
func (m *LockSnapshot) XXX_Size() int
func (*LockSnapshot) XXX_Unmarshal ¶
func (m *LockSnapshot) XXX_Unmarshal(b []byte) error
type Primitive ¶
type Primitive struct{}
Primitive is the counter primitive
func (*Primitive) NewService ¶
func (p *Primitive) NewService(scheduler primitive.Scheduler, context primitive.ServiceContext) primitive.Service
NewService creates a new lock service
type Server ¶
Server is an implementation of MapServiceServer for the map 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) IsLocked ¶
func (s *Server) IsLocked(ctx context.Context, request *api.IsLockedRequest) (*api.IsLockedResponse, error)
IsLocked checks whether the lock is held by any session
func (*Server) Lock ¶
func (s *Server) Lock(ctx context.Context, request *api.LockRequest) (*api.LockResponse, error)
Lock acquires a lock
func (*Server) Unlock ¶
func (s *Server) Unlock(ctx context.Context, request *api.UnlockRequest) (*api.UnlockResponse, error)
Unlock releases the lock
type Service ¶
Service is a state machine for a list primitive
func (*Service) SessionClosed ¶
SessionClosed releases the lock when the owning session is closed
func (*Service) SessionExpired ¶
SessionExpired releases the lock when the owning session expires
type UnlockRequest ¶
type UnlockRequest struct {
Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
}
func (*UnlockRequest) Descriptor ¶
func (*UnlockRequest) Descriptor() ([]byte, []int)
func (*UnlockRequest) GetIndex ¶
func (m *UnlockRequest) GetIndex() int64
func (*UnlockRequest) Marshal ¶
func (m *UnlockRequest) Marshal() (dAtA []byte, err error)
func (*UnlockRequest) MarshalToSizedBuffer ¶
func (m *UnlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*UnlockRequest) ProtoMessage ¶
func (*UnlockRequest) ProtoMessage()
func (*UnlockRequest) Reset ¶
func (m *UnlockRequest) Reset()
func (*UnlockRequest) Size ¶
func (m *UnlockRequest) Size() (n int)
func (*UnlockRequest) String ¶
func (m *UnlockRequest) String() string
func (*UnlockRequest) Unmarshal ¶
func (m *UnlockRequest) Unmarshal(dAtA []byte) error
func (*UnlockRequest) XXX_DiscardUnknown ¶
func (m *UnlockRequest) XXX_DiscardUnknown()
func (*UnlockRequest) XXX_Marshal ¶
func (m *UnlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UnlockRequest) XXX_Merge ¶
func (m *UnlockRequest) XXX_Merge(src proto.Message)
func (*UnlockRequest) XXX_Size ¶
func (m *UnlockRequest) XXX_Size() int
func (*UnlockRequest) XXX_Unmarshal ¶
func (m *UnlockRequest) XXX_Unmarshal(b []byte) error
type UnlockResponse ¶
type UnlockResponse struct {
Succeeded bool `protobuf:"varint,1,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
}
func (*UnlockResponse) Descriptor ¶
func (*UnlockResponse) Descriptor() ([]byte, []int)
func (*UnlockResponse) GetSucceeded ¶
func (m *UnlockResponse) GetSucceeded() bool
func (*UnlockResponse) Marshal ¶
func (m *UnlockResponse) Marshal() (dAtA []byte, err error)
func (*UnlockResponse) MarshalToSizedBuffer ¶
func (m *UnlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*UnlockResponse) ProtoMessage ¶
func (*UnlockResponse) ProtoMessage()
func (*UnlockResponse) Reset ¶
func (m *UnlockResponse) Reset()
func (*UnlockResponse) Size ¶
func (m *UnlockResponse) Size() (n int)
func (*UnlockResponse) String ¶
func (m *UnlockResponse) String() string
func (*UnlockResponse) Unmarshal ¶
func (m *UnlockResponse) Unmarshal(dAtA []byte) error
func (*UnlockResponse) XXX_DiscardUnknown ¶
func (m *UnlockResponse) XXX_DiscardUnknown()
func (*UnlockResponse) XXX_Marshal ¶
func (m *UnlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UnlockResponse) XXX_Merge ¶
func (m *UnlockResponse) XXX_Merge(src proto.Message)
func (*UnlockResponse) XXX_Size ¶
func (m *UnlockResponse) XXX_Size() int
func (*UnlockResponse) XXX_Unmarshal ¶
func (m *UnlockResponse) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.