node

package
v0.0.0-...-70736be Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cmd_name = map[int32]string{
		0: "GET",
		1: "SET",
		2: "DEL",
	}
	Cmd_value = map[string]int32{
		"GET": 0,
		"SET": 1,
		"DEL": 2,
	}
)

Enum value maps for Cmd.

View Source
var CommandApi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "commandApi",
	HandlerType: (*CommandApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _CommandApi_Get_Handler,
		},
		{
			MethodName: "Set",
			Handler:    _CommandApi_Set_Handler,
		},
		{
			MethodName: "Del",
			Handler:    _CommandApi_Del_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "node.proto",
}

CommandApi_ServiceDesc is the grpc.ServiceDesc for CommandApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var CoordinatorApi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "CoordinatorApi",
	HandlerType: (*CoordinatorApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _CoordinatorApi_Get_Handler,
		},
		{
			MethodName: "Set",
			Handler:    _CoordinatorApi_Set_Handler,
		},
		{
			MethodName: "Del",
			Handler:    _CoordinatorApi_Del_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "node.proto",
}

CoordinatorApi_ServiceDesc is the grpc.ServiceDesc for CoordinatorApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterCommandApiServer

func RegisterCommandApiServer(s grpc.ServiceRegistrar, srv CommandApiServer)

func RegisterCoordinatorApiServer

func RegisterCoordinatorApiServer(s grpc.ServiceRegistrar, srv CoordinatorApiServer)

Types

type Cmd

type Cmd int32
const (
	Cmd_GET Cmd = 0
	Cmd_SET Cmd = 1
	Cmd_DEL Cmd = 2
)

func (Cmd) Descriptor

func (Cmd) Descriptor() protoreflect.EnumDescriptor

func (Cmd) Enum

func (x Cmd) Enum() *Cmd

func (Cmd) EnumDescriptor deprecated

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

Deprecated: Use Cmd.Descriptor instead.

func (Cmd) Number

func (x Cmd) Number() protoreflect.EnumNumber

func (Cmd) String

func (x Cmd) String() string

func (Cmd) Type

func (Cmd) Type() protoreflect.EnumType

type Command

type Command struct {
	Cmd  Cmd    `protobuf:"varint,1,opt,name=cmd,proto3,enum=Cmd" json:"cmd,omitempty"`
	Key  string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Command) Descriptor deprecated

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

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetCmd

func (x *Command) GetCmd() Cmd

func (*Command) GetData

func (x *Command) GetData() string

func (*Command) GetKey

func (x *Command) GetKey() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

func (x *Command) ProtoReflect() protoreflect.Message

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type CommandApiClient

type CommandApiClient interface {
	Get(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error)
	Set(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error)
	Del(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error)
}

CommandApiClient is the client API for CommandApi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewCommandApiClient

func NewCommandApiClient(cc grpc.ClientConnInterface) CommandApiClient

type CommandApiServer

type CommandApiServer interface {
	Get(context.Context, *Command) (*CommandResponse, error)
	Set(context.Context, *Command) (*CommandResponse, error)
	Del(context.Context, *Command) (*CommandResponse, error)
	// contains filtered or unexported methods
}

CommandApiServer is the server API for CommandApi service. All implementations must embed UnimplementedCommandApiServer for forward compatibility

type CommandResponse

type CommandResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Data    string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandResponse) Descriptor deprecated

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

Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead.

func (*CommandResponse) GetData

func (x *CommandResponse) GetData() string

func (*CommandResponse) GetSuccess

func (x *CommandResponse) GetSuccess() bool

func (*CommandResponse) ProtoMessage

func (*CommandResponse) ProtoMessage()

func (*CommandResponse) ProtoReflect

func (x *CommandResponse) ProtoReflect() protoreflect.Message

func (*CommandResponse) Reset

func (x *CommandResponse) Reset()

func (*CommandResponse) String

func (x *CommandResponse) String() string

type CoordinatorApiClient

type CoordinatorApiClient interface {
	Get(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CoordinatorResponse, error)
	Set(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CoordinatorResponse, error)
	Del(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CoordinatorResponse, error)
}

CoordinatorApiClient is the client API for CoordinatorApi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type CoordinatorApiServer

type CoordinatorApiServer interface {
	Get(context.Context, *Command) (*CoordinatorResponse, error)
	Set(context.Context, *Command) (*CoordinatorResponse, error)
	Del(context.Context, *Command) (*CoordinatorResponse, error)
	// contains filtered or unexported methods
}

CoordinatorApiServer is the server API for CoordinatorApi service. All implementations must embed UnimplementedCoordinatorApiServer for forward compatibility

type CoordinatorResponse

type CoordinatorResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Data    string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CoordinatorResponse) Descriptor deprecated

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

Deprecated: Use CoordinatorResponse.ProtoReflect.Descriptor instead.

func (*CoordinatorResponse) GetData

func (x *CoordinatorResponse) GetData() string

func (*CoordinatorResponse) GetSuccess

func (x *CoordinatorResponse) GetSuccess() bool

func (*CoordinatorResponse) ProtoMessage

func (*CoordinatorResponse) ProtoMessage()

func (*CoordinatorResponse) ProtoReflect

func (x *CoordinatorResponse) ProtoReflect() protoreflect.Message

func (*CoordinatorResponse) Reset

func (x *CoordinatorResponse) Reset()

func (*CoordinatorResponse) String

func (x *CoordinatorResponse) String() string

type Event

type Event struct {
	Id     uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	LClock uint64 `protobuf:"varint,2,opt,name=LClock,proto3" json:"LClock,omitempty"`
	Origin string `protobuf:"bytes,3,opt,name=Origin,proto3" json:"Origin,omitempty"`
	From   string `protobuf:"bytes,4,opt,name=From,proto3" json:"From,omitempty"`
	// Types that are assignable to Payload:
	//
	//	*Event_Noop
	//	*Event_RingState
	Payload isEvent_Payload `protobuf_oneof:"Payload"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetFrom

func (x *Event) GetFrom() string

func (*Event) GetId

func (x *Event) GetId() uint64

func (*Event) GetLClock

func (x *Event) GetLClock() uint64

func (*Event) GetNoop

func (x *Event) GetNoop() *Noop

func (*Event) GetOrigin

func (x *Event) GetOrigin() string

func (*Event) GetPayload

func (m *Event) GetPayload() isEvent_Payload

func (*Event) GetRingState

func (x *Event) GetRingState() *RingState

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type Event_Noop

type Event_Noop struct {
	Noop *Noop `protobuf:"bytes,101,opt,name=noop,proto3,oneof"`
}

type Event_RingState

type Event_RingState struct {
	RingState *RingState `protobuf:"bytes,102,opt,name=ringState,proto3,oneof"`
}

type NodeState

type NodeState struct {
	Name     string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Host     string   `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	Port     uint32   `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	RamSize  uint32   `protobuf:"varint,4,opt,name=ramSize,proto3" json:"ramSize,omitempty"`
	VNumbers []uint32 `protobuf:"varint,5,rep,packed,name=vNumbers,proto3" json:"vNumbers,omitempty"`
	// contains filtered or unexported fields
}

---------------------------------- Internal messages exchanged between nodes during gossip phase

func (*NodeState) Descriptor deprecated

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

Deprecated: Use NodeState.ProtoReflect.Descriptor instead.

func (*NodeState) GetHost

func (x *NodeState) GetHost() string

func (*NodeState) GetName

func (x *NodeState) GetName() string

func (*NodeState) GetPort

func (x *NodeState) GetPort() uint32

func (*NodeState) GetRamSize

func (x *NodeState) GetRamSize() uint32

func (*NodeState) GetVNumbers

func (x *NodeState) GetVNumbers() []uint32

func (*NodeState) ProtoMessage

func (*NodeState) ProtoMessage()

func (*NodeState) ProtoReflect

func (x *NodeState) ProtoReflect() protoreflect.Message

func (*NodeState) Reset

func (x *NodeState) Reset()

func (*NodeState) String

func (x *NodeState) String() string

type Noop

type Noop struct {
	// contains filtered or unexported fields
}

func (*Noop) Descriptor deprecated

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

Deprecated: Use Noop.ProtoReflect.Descriptor instead.

func (*Noop) ProtoMessage

func (*Noop) ProtoMessage()

func (*Noop) ProtoReflect

func (x *Noop) ProtoReflect() protoreflect.Message

func (*Noop) Reset

func (x *Noop) Reset()

func (*Noop) String

func (x *Noop) String() string

type RingState

type RingState struct {
	NodeStates []*NodeState `protobuf:"bytes,1,rep,name=nodeStates,proto3" json:"nodeStates,omitempty"`
	// contains filtered or unexported fields
}

func (*RingState) Descriptor deprecated

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

Deprecated: Use RingState.ProtoReflect.Descriptor instead.

func (*RingState) GetNodeStates

func (x *RingState) GetNodeStates() []*NodeState

func (*RingState) ProtoMessage

func (*RingState) ProtoMessage()

func (*RingState) ProtoReflect

func (x *RingState) ProtoReflect() protoreflect.Message

func (*RingState) Reset

func (x *RingState) Reset()

func (*RingState) String

func (x *RingState) String() string

type UnimplementedCommandApiServer

type UnimplementedCommandApiServer struct {
}

UnimplementedCommandApiServer must be embedded to have forward compatible implementations.

func (UnimplementedCommandApiServer) Del

func (UnimplementedCommandApiServer) Get

func (UnimplementedCommandApiServer) Set

type UnimplementedCoordinatorApiServer

type UnimplementedCoordinatorApiServer struct {
}

UnimplementedCoordinatorApiServer must be embedded to have forward compatible implementations.

func (UnimplementedCoordinatorApiServer) Del

func (UnimplementedCoordinatorApiServer) Get

func (UnimplementedCoordinatorApiServer) Set

type UnsafeCommandApiServer

type UnsafeCommandApiServer interface {
	// contains filtered or unexported methods
}

UnsafeCommandApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CommandApiServer will result in compilation errors.

type UnsafeCoordinatorApiServer

type UnsafeCoordinatorApiServer interface {
	// contains filtered or unexported methods
}

UnsafeCoordinatorApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CoordinatorApiServer will result in compilation errors.

Jump to

Keyboard shortcuts

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