dsync

package
v0.0.0-...-3e94386 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDistSyncServer

func RegisterDistSyncServer(s *grpc.Server, srv DistSyncServer)

Types

type DistSyncClient

type DistSyncClient interface {
	// Request for Distributed Lock
	Request(ctx context.Context, in *LockReq, opts ...grpc.CallOption) (*Node, error)
	// Request for Distributed Lock
	Reply(ctx context.Context, in *Node, opts ...grpc.CallOption) (*Node, error)
	// Relinquish Distributed Lock
	Relinquish(ctx context.Context, in *Node, opts ...grpc.CallOption) (*Node, error)
	// Inquire on status of Distributed Lock from head of queue
	Inquire(ctx context.Context, in *Node, opts ...grpc.CallOption) (*InquireReply, error)
	// Validate health of node holding Distributed Lock
	Validate(ctx context.Context, in *Node, opts ...grpc.CallOption) (*ValidateReply, error)
}

DistSyncClient is the client API for DistSync service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDistSyncClient

func NewDistSyncClient(cc *grpc.ClientConn) DistSyncClient

type DistSyncServer

type DistSyncServer interface {
	// Request for Distributed Lock
	Request(context.Context, *LockReq) (*Node, error)
	// Request for Distributed Lock
	Reply(context.Context, *Node) (*Node, error)
	// Relinquish Distributed Lock
	Relinquish(context.Context, *Node) (*Node, error)
	// Inquire on status of Distributed Lock from head of queue
	Inquire(context.Context, *Node) (*InquireReply, error)
	// Validate health of node holding Distributed Lock
	Validate(context.Context, *Node) (*ValidateReply, error)
}

DistSyncServer is the server API for DistSync service.

type InquireReply

type InquireReply struct {
	Yield                bool     `protobuf:"varint,1,opt,name=yield,proto3" json:"yield,omitempty"`
	Relinquish           bool     `protobuf:"varint,2,opt,name=relinquish,proto3" json:"relinquish,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Response to an Inquire message. May either yield or relinquish

func (*InquireReply) Descriptor

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

func (*InquireReply) GetRelinquish

func (m *InquireReply) GetRelinquish() bool

func (*InquireReply) GetYield

func (m *InquireReply) GetYield() bool

func (*InquireReply) ProtoMessage

func (*InquireReply) ProtoMessage()

func (*InquireReply) Reset

func (m *InquireReply) Reset()

func (*InquireReply) String

func (m *InquireReply) String() string

func (*InquireReply) XXX_DiscardUnknown

func (m *InquireReply) XXX_DiscardUnknown()

func (*InquireReply) XXX_Marshal

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

func (*InquireReply) XXX_Merge

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

func (*InquireReply) XXX_Size

func (m *InquireReply) XXX_Size() int

func (*InquireReply) XXX_Unmarshal

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

type LockReq

type LockReq struct {
	Node                 string               `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	Tstmp                *timestamp.Timestamp `protobuf:"bytes,2,opt,name=tstmp,proto3" json:"tstmp,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Request the distributed lock

func (*LockReq) Descriptor

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

func (*LockReq) GetNode

func (m *LockReq) GetNode() string

func (*LockReq) GetTstmp

func (m *LockReq) GetTstmp() *timestamp.Timestamp

func (*LockReq) ProtoMessage

func (*LockReq) ProtoMessage()

func (*LockReq) Reset

func (m *LockReq) Reset()

func (*LockReq) String

func (m *LockReq) String() string

func (*LockReq) XXX_DiscardUnknown

func (m *LockReq) XXX_DiscardUnknown()

func (*LockReq) XXX_Marshal

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

func (*LockReq) XXX_Merge

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

func (*LockReq) XXX_Size

func (m *LockReq) XXX_Size() int

func (*LockReq) XXX_Unmarshal

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

type Node

type Node struct {
	Node                 string   `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

for Reply, Inquire, and Relinquish messages

func (*Node) Descriptor

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

func (*Node) GetNode

func (m *Node) GetNode() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) String

func (m *Node) String() string

func (*Node) XXX_DiscardUnknown

func (m *Node) XXX_DiscardUnknown()

func (*Node) XXX_Marshal

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

func (*Node) XXX_Merge

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

func (*Node) XXX_Size

func (m *Node) XXX_Size() int

func (*Node) XXX_Unmarshal

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

type ValidateReply

type ValidateReply struct {
	Holding              bool     `protobuf:"varint,1,opt,name=holding,proto3" json:"holding,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Response to a Validate message. Return True if lock is still being held

func (*ValidateReply) Descriptor

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

func (*ValidateReply) GetHolding

func (m *ValidateReply) GetHolding() bool

func (*ValidateReply) ProtoMessage

func (*ValidateReply) ProtoMessage()

func (*ValidateReply) Reset

func (m *ValidateReply) Reset()

func (*ValidateReply) String

func (m *ValidateReply) String() string

func (*ValidateReply) XXX_DiscardUnknown

func (m *ValidateReply) XXX_DiscardUnknown()

func (*ValidateReply) XXX_Marshal

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

func (*ValidateReply) XXX_Merge

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

func (*ValidateReply) XXX_Size

func (m *ValidateReply) XXX_Size() int

func (*ValidateReply) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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