nodes

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Action_name = map[int32]string{
		0: "NOTHING",
		1: "UP",
		2: "DOWN",
	}
	Action_value = map[string]int32{
		"NOTHING": 0,
		"UP":      1,
		"DOWN":    2,
	}
)

Enum value maps for Action.

View Source
var (
	Type_name = map[int32]string{
		0: "TYPE_UNKNOWN",
		1: "TYPE_WORKER",
		2: "TYPE_CHANNEL",
		3: "TYPE_MANAGER",
		4: "TYPE_NODE",
		5: "TYPE_CLUSTER",
	}
	Type_value = map[string]int32{
		"TYPE_UNKNOWN": 0,
		"TYPE_WORKER":  1,
		"TYPE_CHANNEL": 2,
		"TYPE_MANAGER": 3,
		"TYPE_NODE":    4,
		"TYPE_CLUSTER": 5,
	}
)

Enum value maps for Type.

View Source
var (
	ChanType_name = map[int32]string{
		0: "CHAN_UNKNOWN",
		1: "CHAN_STD_GO",
		2: "CHAN_STACK",
		3: "CHAN_PRIORITY_QUEUE",
	}
	ChanType_value = map[string]int32{
		"CHAN_UNKNOWN":        0,
		"CHAN_STD_GO":         1,
		"CHAN_STACK":          2,
		"CHAN_PRIORITY_QUEUE": 3,
	}
)

Enum value maps for ChanType.

View Source
var File_protobuf_proto_masternode_proto protoreflect.FileDescriptor

Functions

func RegisterMasterNodeServer

func RegisterMasterNodeServer(s *grpc.Server, srv MasterNodeServer)

Types

type Action

type Action int32

* enum Action is a rule of conduct the managers

const (
	Action_NOTHING Action = 0
	Action_UP      Action = 1
	Action_DOWN    Action = 2
)

func (Action) Descriptor

func (Action) Descriptor() protoreflect.EnumDescriptor

func (Action) Enum

func (x Action) Enum() *Action

func (Action) EnumDescriptor deprecated

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

Deprecated: Use Action.Descriptor instead.

func (Action) Number

func (x Action) Number() protoreflect.EnumNumber

func (Action) String

func (x Action) String() string

func (Action) Type

func (Action) Type() protoreflect.EnumType

type ChanData

type ChanData struct {
	IsExisted  bool     `protobuf:"varint,1,opt,name=IsExisted,proto3" json:"IsExisted,omitempty"`           // last manager has false for out channel
	Type       ChanType `protobuf:"varint,2,opt,name=Type,proto3,enum=nodes.ChanType" json:"Type,omitempty"` //  type of channel. last manager has UNKNOWN for out channel
	Length     uint32   `protobuf:"varint,3,opt,name=Length,proto3" json:"Length,omitempty"`                 // length of channel
	NumberInCh uint32   `protobuf:"varint,4,opt,name=NumberInCh,proto3" json:"NumberInCh,omitempty"`         // number of items in channel right now
	// number of workers which are serving the channel right now. Usually it equals the WorkersData.Number
	NumberOfWorkers uint32 `protobuf:"varint,5,opt,name=NumberOfWorkers,proto3" json:"NumberOfWorkers,omitempty"`
	// contains filtered or unexported fields
}

* message ChanData contents the information about single channel

func (*ChanData) Descriptor deprecated

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

Deprecated: Use ChanData.ProtoReflect.Descriptor instead.

func (*ChanData) GetIsExisted

func (x *ChanData) GetIsExisted() bool

func (*ChanData) GetLength

func (x *ChanData) GetLength() uint32

func (*ChanData) GetNumberInCh

func (x *ChanData) GetNumberInCh() uint32

func (*ChanData) GetNumberOfWorkers

func (x *ChanData) GetNumberOfWorkers() uint32

func (*ChanData) GetType

func (x *ChanData) GetType() ChanType

func (*ChanData) ProtoMessage

func (*ChanData) ProtoMessage()

func (*ChanData) ProtoReflect

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

func (*ChanData) Reset

func (x *ChanData) Reset()

func (*ChanData) String

func (x *ChanData) String() string

type ChanType

type ChanType int32

* enum ChanType is a type of channel

const (
	ChanType_CHAN_UNKNOWN        ChanType = 0 // when channel is not is existed
	ChanType_CHAN_STD_GO         ChanType = 1 // core go library channel aka make(chan <type>, length)
	ChanType_CHAN_STACK          ChanType = 2 //
	ChanType_CHAN_PRIORITY_QUEUE ChanType = 3 //
)

func (ChanType) Descriptor

func (ChanType) Descriptor() protoreflect.EnumDescriptor

func (ChanType) Enum

func (x ChanType) Enum() *ChanType

func (ChanType) EnumDescriptor deprecated

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

Deprecated: Use ChanType.Descriptor instead.

func (ChanType) Number

func (x ChanType) Number() protoreflect.EnumNumber

func (ChanType) String

func (x ChanType) String() string

func (ChanType) Type

type ManagerAction

type ManagerAction struct {
	Type   Type   `protobuf:"varint,1,opt,name=Type,json=type,proto3,enum=nodes.Type" json:"Type,omitempty"`
	Action Action `protobuf:"varint,2,opt,name=Action,json=action,proto3,enum=nodes.Action" json:"Action,omitempty"`
	Delta  int32  `protobuf:"varint,3,opt,name=Delta,json=number,proto3" json:"Delta,omitempty"`
	// contains filtered or unexported fields
}

func (*ManagerAction) Descriptor deprecated

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

Deprecated: Use ManagerAction.ProtoReflect.Descriptor instead.

func (*ManagerAction) GetAction

func (x *ManagerAction) GetAction() Action

func (*ManagerAction) GetDelta

func (x *ManagerAction) GetDelta() int32

func (*ManagerAction) GetType

func (x *ManagerAction) GetType() Type

func (*ManagerAction) ProtoMessage

func (*ManagerAction) ProtoMessage()

func (*ManagerAction) ProtoReflect

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

func (*ManagerAction) Reset

func (x *ManagerAction) Reset()

func (*ManagerAction) String

func (x *ManagerAction) String() string

type ManagerData

type ManagerData struct {
	Name       string               `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	ID         string               `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"`
	Created    *timestamp.Timestamp `protobuf:"bytes,3,opt,name=Created,proto3" json:"Created,omitempty"` // time of getting into
	Delta      uint64               `protobuf:"varint,4,opt,name=Delta,proto3" json:"Delta,omitempty"`    // number of microseconds from last getting into
	Workers    *WorkersData         `protobuf:"bytes,5,opt,name=Workers,proto3" json:"Workers,omitempty"`
	ChanBefore []*ChanData          `protobuf:"bytes,6,rep,name=ChanBefore,proto3" json:"ChanBefore,omitempty"`
	ChanAfter  []*ChanData          `protobuf:"bytes,7,rep,name=ChanAfter,proto3" json:"ChanAfter,omitempty"`
	// contains filtered or unexported fields
}

* message ManagerData contents the information about single manager

func (*ManagerData) Descriptor deprecated

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

Deprecated: Use ManagerData.ProtoReflect.Descriptor instead.

func (*ManagerData) GetChanAfter

func (x *ManagerData) GetChanAfter() []*ChanData

func (*ManagerData) GetChanBefore

func (x *ManagerData) GetChanBefore() []*ChanData

func (*ManagerData) GetCreated

func (x *ManagerData) GetCreated() *timestamp.Timestamp

func (*ManagerData) GetDelta

func (x *ManagerData) GetDelta() uint64

func (*ManagerData) GetID

func (x *ManagerData) GetID() string

func (*ManagerData) GetName

func (x *ManagerData) GetName() string

func (*ManagerData) GetWorkers

func (x *ManagerData) GetWorkers() *WorkersData

func (*ManagerData) ProtoMessage

func (*ManagerData) ProtoMessage()

func (*ManagerData) ProtoReflect

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

func (*ManagerData) Reset

func (x *ManagerData) Reset()

func (*ManagerData) String

func (x *ManagerData) String() string

type MasterNodeClient

type MasterNodeClient interface {
	// rpc UpdateNodeInfo sends info about current details of slave node to master node
	UpdateNodeInfo(ctx context.Context, in *SlaveNodeInfoRequest, opts ...grpc.CallOption) (*SimpleResult, error)
}

MasterNodeClient is the client API for MasterNode service.

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

func NewMasterNodeClient

func NewMasterNodeClient(cc grpc.ClientConnInterface) MasterNodeClient

type MasterNodeServer

type MasterNodeServer interface {
	// rpc UpdateNodeInfo sends info about current details of slave node to master node
	UpdateNodeInfo(context.Context, *SlaveNodeInfoRequest) (*SimpleResult, error)
}

MasterNodeServer is the server API for MasterNode service.

type SimpleResult

type SimpleResult struct {
	OK bool `protobuf:"varint,1,opt,name=OK,json=ok,proto3" json:"OK,omitempty"`
	// contains filtered or unexported fields
}

* To be or not to be

func (*SimpleResult) Descriptor deprecated

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

Deprecated: Use SimpleResult.ProtoReflect.Descriptor instead.

func (*SimpleResult) GetOK

func (x *SimpleResult) GetOK() bool

func (*SimpleResult) ProtoMessage

func (*SimpleResult) ProtoMessage()

func (*SimpleResult) ProtoReflect

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

func (*SimpleResult) Reset

func (x *SimpleResult) Reset()

func (*SimpleResult) String

func (x *SimpleResult) String() string

type SlaveNodeInfoRequest

type SlaveNodeInfoRequest struct {
	ClusterID        string         `protobuf:"bytes,1,opt,name=ClusterID,proto3" json:"ClusterID,omitempty"`               // unique name of cluster. No specific info
	NodeID           string         `protobuf:"bytes,2,opt,name=NodeID,proto3" json:"NodeID,omitempty"`                     // unique name of node. No specific info
	ManagerData      []*ManagerData `protobuf:"bytes,3,rep,name=ManagerData,proto3" json:"ManagerData,omitempty"`           //
	FinalManagerData []*ManagerData `protobuf:"bytes,4,rep,name=FinalManagerData,proto3" json:"FinalManagerData,omitempty"` //
	ErrorManagerData []*ManagerData `protobuf:"bytes,5,rep,name=ErrorManagerData,proto3" json:"ErrorManagerData,omitempty"` //
	// contains filtered or unexported fields
}

* SlaveNodeInfoRequest is a request with slave node data to master node

func (*SlaveNodeInfoRequest) Descriptor deprecated

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

Deprecated: Use SlaveNodeInfoRequest.ProtoReflect.Descriptor instead.

func (*SlaveNodeInfoRequest) GetClusterID

func (x *SlaveNodeInfoRequest) GetClusterID() string

func (*SlaveNodeInfoRequest) GetErrorManagerData

func (x *SlaveNodeInfoRequest) GetErrorManagerData() []*ManagerData

func (*SlaveNodeInfoRequest) GetFinalManagerData

func (x *SlaveNodeInfoRequest) GetFinalManagerData() []*ManagerData

func (*SlaveNodeInfoRequest) GetManagerData

func (x *SlaveNodeInfoRequest) GetManagerData() []*ManagerData

func (*SlaveNodeInfoRequest) GetNodeID

func (x *SlaveNodeInfoRequest) GetNodeID() string

func (*SlaveNodeInfoRequest) ProtoMessage

func (*SlaveNodeInfoRequest) ProtoMessage()

func (*SlaveNodeInfoRequest) ProtoReflect

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

func (*SlaveNodeInfoRequest) Reset

func (x *SlaveNodeInfoRequest) Reset()

func (*SlaveNodeInfoRequest) String

func (x *SlaveNodeInfoRequest) String() string

type Type

type Type int32

* enum Type is a type of ruling objects

const (
	Type_TYPE_UNKNOWN Type = 0
	Type_TYPE_WORKER  Type = 1
	Type_TYPE_CHANNEL Type = 2
	Type_TYPE_MANAGER Type = 3
	Type_TYPE_NODE    Type = 4
	Type_TYPE_CLUSTER Type = 5
)

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

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

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

type UnimplementedMasterNodeServer

type UnimplementedMasterNodeServer struct {
}

UnimplementedMasterNodeServer can be embedded to have forward compatible implementations.

func (*UnimplementedMasterNodeServer) UpdateNodeInfo

type WorkersData

type WorkersData struct {
	Min    uint32 `protobuf:"varint,1,opt,name=Min,proto3" json:"Min,omitempty"`       // available minimum of number of workers
	Max    uint32 `protobuf:"varint,2,opt,name=Max,proto3" json:"Max,omitempty"`       // available maximum of number of workers
	Number uint32 `protobuf:"varint,3,opt,name=Number,proto3" json:"Number,omitempty"` // total number of workers right now
	Active uint32 `protobuf:"varint,4,opt,name=Active,proto3" json:"Active,omitempty"` // number of workers these are active right now
	// contains filtered or unexported fields
}

* message WorkersData contents the information about workers for single manager

func (*WorkersData) Descriptor deprecated

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

Deprecated: Use WorkersData.ProtoReflect.Descriptor instead.

func (*WorkersData) GetActive

func (x *WorkersData) GetActive() uint32

func (*WorkersData) GetMax

func (x *WorkersData) GetMax() uint32

func (*WorkersData) GetMin

func (x *WorkersData) GetMin() uint32

func (*WorkersData) GetNumber

func (x *WorkersData) GetNumber() uint32

func (*WorkersData) ProtoMessage

func (*WorkersData) ProtoMessage()

func (*WorkersData) ProtoReflect

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

func (*WorkersData) Reset

func (x *WorkersData) Reset()

func (*WorkersData) String

func (x *WorkersData) String() string

Jump to

Keyboard shortcuts

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