common

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MOMKAT string = "MOMKAT"
	ALL    string = "ALL"
)

Definitions of Command Type

View Source
const (

	/////////////////////////// StatusZone Table
	MaxSpiders          = "20"
	TransCount          = "3"
	TimerTime           = 10   // seconds (HeartBeat)
	ChildKatCallTimeout = 3000 // milliseconds

	//// metadata base position of Table
	// Status Table
	StatusSheetName = "StatusZone"
	// X
	StatusRowLockX  = "b"
	StatusSpiderIDX = "c"
	StatusStatusX   = "d"
	StatusTimeX     = "e"
	StatusCountX    = "f"
	// Y
	StatusTableY = "5"

	/////////////////////////// CommandZone Table
	//// metadata base position of Table
	// Command Queue Table
	MaxCommands = "10"

	// Command Table
	CommandSheetName = "CommandZone"
	// X
	CommandIDX   = "b"
	CommandTypeX = "c"
	CommandCMDX  = "d"

	CommandSpiderIDX          = "g"
	CommandResultNow          = "h"
	CommandResultBefore       = "i"
	CommandResultBeforeBefore = "j"
	CommandResultTimeX        = "k"
	// Y
	CommandTableY = "5"
)

Variables

View Source
var (
	ErrInvalidLengthMeerkat        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMeerkat          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMeerkat = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ResetFlag bool

Functions

func ClearCheckBit

func ClearCheckBit(strY string) error

func GetCurrentTime

func GetCurrentTime() string

func GetMaxSpiders

func GetMaxSpiders() int

func GetTableHandler

func GetTableHandler() (*sheets.Service, error)

func RegisterChildStatusServer

func RegisterChildStatusServer(s *grpc.Server, srv ChildStatusServer)

func RegisterRunCommandServer

func RegisterRunCommandServer(s *grpc.Server, srv RunCommandServer)

func ResetTimer

func ResetTimer()

called by ChildKat:GetChildStatus()

func RunCommand

func RunCommand(cmd string, serverID string) string

func SetCheckBit

func SetCheckBit(strY string) error

func StartTimer

func StartTimer()

called by MomKat:CheckChildKatAndSet()

func WriteCommandResult

func WriteCommandResult(commandResultInfo *CommandResultInfo) error

func WriteStatusInfo

func WriteStatusInfo(statusInfo *StatusInfo) error

Types

type ChildStatusClient

type ChildStatusClient interface {
	// Sends a request of Resource status
	GetChildStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Status, error)
}

ChildStatusClient is the client API for ChildStatus service.

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

func NewChildStatusClient

func NewChildStatusClient(cc *grpc.ClientConn) ChildStatusClient

type ChildStatusServer

type ChildStatusServer interface {
	// Sends a request of Resource status
	GetChildStatus(context.Context, *Empty) (*Status, error)
}

ChildStatusServer is the server API for ChildStatus service.

type Command

type Command struct {
	CMDID                string   `protobuf:"bytes,1,opt,name=CMDID,proto3" json:"CMDID,omitempty"`
	CMDTYPE              string   `protobuf:"bytes,2,opt,name=CMDTYPE,proto3" json:"CMDTYPE,omitempty"`
	CMD                  string   `protobuf:"bytes,3,opt,name=CMD,proto3" json:"CMD,omitempty"`
	Time                 string   `protobuf:"bytes,4,opt,name=Time,proto3" json:"Time,omitempty"`
	Reserved             string   `protobuf:"bytes,5,opt,name=Reserved,proto3" json:"Reserved,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The input message containing for a ChildKat to run

func (*Command) Descriptor

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

func (*Command) GetCMD

func (m *Command) GetCMD() string

func (*Command) GetCMDID

func (m *Command) GetCMDID() string

func (*Command) GetCMDTYPE

func (m *Command) GetCMDTYPE() string

func (*Command) GetReserved

func (m *Command) GetReserved() string

func (*Command) GetTime

func (m *Command) GetTime() string

func (*Command) Marshal

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

func (*Command) MarshalTo

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

func (*Command) MarshalToSizedBuffer

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

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) Size

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

func (*Command) String

func (m *Command) String() string

func (*Command) Unmarshal

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

func (*Command) XXX_DiscardUnknown

func (m *Command) XXX_DiscardUnknown()

func (*Command) XXX_Marshal

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

func (*Command) XXX_Merge

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

func (*Command) XXX_Size

func (m *Command) XXX_Size() int

func (*Command) XXX_Unmarshal

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

type CommandResult

type CommandResult struct {
	ServerID             string   `protobuf:"bytes,1,opt,name=ServerID,proto3" json:"ServerID,omitempty"`
	CMD                  string   `protobuf:"bytes,2,opt,name=CMD,proto3" json:"CMD,omitempty"`
	Result               string   `protobuf:"bytes,3,opt,name=Result,proto3" json:"Result,omitempty"`
	Time                 string   `protobuf:"bytes,4,opt,name=Time,proto3" json:"Time,omitempty"`
	Reserved             string   `protobuf:"bytes,5,opt,name=Reserved,proto3" json:"Reserved,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The response message containing a ChildKat Command Result

func (*CommandResult) Descriptor

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

func (*CommandResult) GetCMD

func (m *CommandResult) GetCMD() string

func (*CommandResult) GetReserved

func (m *CommandResult) GetReserved() string

func (*CommandResult) GetResult

func (m *CommandResult) GetResult() string

func (*CommandResult) GetServerID

func (m *CommandResult) GetServerID() string

func (*CommandResult) GetTime

func (m *CommandResult) GetTime() string

func (*CommandResult) Marshal

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

func (*CommandResult) MarshalTo

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

func (*CommandResult) MarshalToSizedBuffer

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

func (*CommandResult) ProtoMessage

func (*CommandResult) ProtoMessage()

func (*CommandResult) Reset

func (m *CommandResult) Reset()

func (*CommandResult) Size

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

func (*CommandResult) String

func (m *CommandResult) String() string

func (*CommandResult) Unmarshal

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

func (*CommandResult) XXX_DiscardUnknown

func (m *CommandResult) XXX_DiscardUnknown()

func (*CommandResult) XXX_Marshal

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

func (*CommandResult) XXX_Merge

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

func (*CommandResult) XXX_Size

func (m *CommandResult) XXX_Size() int

func (*CommandResult) XXX_Unmarshal

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

type CommandResultInfo

type CommandResultInfo struct {
	RowNumber          string
	ServerID           string
	ResultNow          string
	ResultBefore       string
	ResultBeforeBefore string
	Time               string
}

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request message with empty

func (*Empty) Descriptor

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

func (*Empty) Marshal

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

func (*Empty) MarshalTo

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

func (*Empty) MarshalToSizedBuffer

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) Size

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

func (*Empty) String

func (m *Empty) String() string

func (*Empty) Unmarshal

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

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

type RunCommandClient

type RunCommandClient interface {
	RunCommand(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResult, error)
}

RunCommandClient is the client API for RunCommand service.

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

func NewRunCommandClient

func NewRunCommandClient(cc *grpc.ClientConn) RunCommandClient

type RunCommandServer

type RunCommandServer interface {
	RunCommand(context.Context, *Command) (*CommandResult, error)
}

RunCommandServer is the server API for RunCommand service.

type Status

type Status struct {
	ServerID             string   `protobuf:"bytes,1,opt,name=ServerID,proto3" json:"ServerID,omitempty"`
	Status               string   `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"`
	Time                 string   `protobuf:"bytes,3,opt,name=Time,proto3" json:"Time,omitempty"`
	Reserved             string   `protobuf:"bytes,4,opt,name=Reserved,proto3" json:"Reserved,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The response message containing a ChildKat status

func (*Status) Descriptor

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

func (*Status) GetReserved

func (m *Status) GetReserved() string

func (*Status) GetServerID

func (m *Status) GetServerID() string

func (*Status) GetStatus

func (m *Status) GetStatus() string

func (*Status) GetTime

func (m *Status) GetTime() string

func (*Status) Marshal

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

func (*Status) MarshalTo

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

func (*Status) MarshalToSizedBuffer

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

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) Size

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

func (*Status) String

func (m *Status) String() string

func (*Status) Unmarshal

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

func (*Status) XXX_DiscardUnknown

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal

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

func (*Status) XXX_Merge

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

func (*Status) XXX_Size

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal

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

type StatusInfo

type StatusInfo struct {
	RowNumber string
	CheckBit  string
	ServerID  string
	Status    string
	Time      string
	Count     string
}

type UnimplementedChildStatusServer

type UnimplementedChildStatusServer struct {
}

UnimplementedChildStatusServer can be embedded to have forward compatible implementations.

func (*UnimplementedChildStatusServer) GetChildStatus

func (*UnimplementedChildStatusServer) GetChildStatus(ctx context.Context, req *Empty) (*Status, error)

type UnimplementedRunCommandServer

type UnimplementedRunCommandServer struct {
}

UnimplementedRunCommandServer can be embedded to have forward compatible implementations.

func (*UnimplementedRunCommandServer) RunCommand

Jump to

Keyboard shortcuts

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