687
proto/portal/portal.pb.go
Normal file
687
proto/portal/portal.pb.go
Normal file
@@ -0,0 +1,687 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.17.3
|
||||
// source: portal/portal.proto
|
||||
|
||||
package portal
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type State int32
|
||||
|
||||
const (
|
||||
State_UNKNOWN State = 0
|
||||
State_CHANGED State = 1
|
||||
State_UNCHANGED State = 2
|
||||
)
|
||||
|
||||
// Enum value maps for State.
|
||||
var (
|
||||
State_name = map[int32]string{
|
||||
0: "UNKNOWN",
|
||||
1: "CHANGED",
|
||||
2: "UNCHANGED",
|
||||
}
|
||||
State_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
"CHANGED": 1,
|
||||
"UNCHANGED": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x State) Enum() *State {
|
||||
p := new(State)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x State) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (State) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_portal_portal_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (State) Type() protoreflect.EnumType {
|
||||
return &file_portal_portal_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x State) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use State.Descriptor instead.
|
||||
func (State) EnumDescriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type CommandRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CommandRequest) Reset() {
|
||||
*x = CommandRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CommandRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CommandRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CommandRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CommandRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CommandRequest) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CommandRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CommandRequest) GetArgs() []string {
|
||||
if x != nil {
|
||||
return x.Args
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CommandResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
State State `protobuf:"varint,1,opt,name=state,proto3,enum=portal.State" json:"state,omitempty"`
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CommandResponse) Reset() {
|
||||
*x = CommandResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CommandResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CommandResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CommandResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CommandResponse) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CommandResponse) GetState() State {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return State_UNKNOWN
|
||||
}
|
||||
|
||||
func (x *CommandResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ServiceRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ServiceRequest) Reset() {
|
||||
*x = ServiceRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ServiceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServiceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ServiceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServiceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ServiceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ServiceRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ServiceResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
State State `protobuf:"varint,1,opt,name=state,proto3,enum=portal.State" json:"state,omitempty"`
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ServiceResponse) Reset() {
|
||||
*x = ServiceResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ServiceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServiceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ServiceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServiceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ServiceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ServiceResponse) GetState() State {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return State_UNKNOWN
|
||||
}
|
||||
|
||||
func (x *ServiceResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ServiceStatusResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
State State `protobuf:"varint,1,opt,name=state,proto3,enum=portal.State" json:"state,omitempty"`
|
||||
Loadstate string `protobuf:"bytes,2,opt,name=loadstate,proto3" json:"loadstate,omitempty"`
|
||||
Activestate string `protobuf:"bytes,3,opt,name=activestate,proto3" json:"activestate,omitempty"`
|
||||
Substate string `protobuf:"bytes,4,opt,name=substate,proto3" json:"substate,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ServiceStatusResponse) Reset() {
|
||||
*x = ServiceStatusResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ServiceStatusResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServiceStatusResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ServiceStatusResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServiceStatusResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ServiceStatusResponse) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ServiceStatusResponse) GetState() State {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return State_UNKNOWN
|
||||
}
|
||||
|
||||
func (x *ServiceStatusResponse) GetLoadstate() string {
|
||||
if x != nil {
|
||||
return x.Loadstate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ServiceStatusResponse) GetActivestate() string {
|
||||
if x != nil {
|
||||
return x.Activestate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ServiceStatusResponse) GetSubstate() string {
|
||||
if x != nil {
|
||||
return x.Substate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CPUusageRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *CPUusageRequest) Reset() {
|
||||
*x = CPUusageRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CPUusageRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CPUusageRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CPUusageRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CPUusageRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CPUusageRequest) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
type CPUusageResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Loadavg1 int32 `protobuf:"varint,1,opt,name=loadavg1,proto3" json:"loadavg1,omitempty"`
|
||||
Loadavg5 int32 `protobuf:"varint,2,opt,name=loadavg5,proto3" json:"loadavg5,omitempty"`
|
||||
Loadavg15 int32 `protobuf:"varint,3,opt,name=loadavg15,proto3" json:"loadavg15,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CPUusageResponse) Reset() {
|
||||
*x = CPUusageResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_portal_portal_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CPUusageResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CPUusageResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CPUusageResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_portal_portal_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CPUusageResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CPUusageResponse) Descriptor() ([]byte, []int) {
|
||||
return file_portal_portal_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *CPUusageResponse) GetLoadavg1() int32 {
|
||||
if x != nil {
|
||||
return x.Loadavg1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CPUusageResponse) GetLoadavg5() int32 {
|
||||
if x != nil {
|
||||
return x.Loadavg5
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CPUusageResponse) GetLoadavg15() int32 {
|
||||
if x != nil {
|
||||
return x.Loadavg15
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_portal_portal_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_portal_portal_proto_rawDesc = []byte{
|
||||
0x0a, 0x13, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x22, 0x38, 0x0a,
|
||||
0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
|
||||
0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x50, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
|
||||
0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74,
|
||||
0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x6f, 0x72, 0x74,
|
||||
0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
|
||||
0x50, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65,
|
||||
0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x22, 0x98, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73,
|
||||
0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x6f, 0x72,
|
||||
0x74, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20,
|
||||
0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x73, 0x75, 0x62, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x11, 0x0a, 0x0f,
|
||||
0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
|
||||
0x68, 0x0a, 0x10, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x61, 0x64, 0x61, 0x76, 0x67, 0x31, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x6f, 0x61, 0x64, 0x61, 0x76, 0x67, 0x31, 0x12,
|
||||
0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x61, 0x64, 0x61, 0x76, 0x67, 0x35, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x08, 0x6c, 0x6f, 0x61, 0x64, 0x61, 0x76, 0x67, 0x35, 0x12, 0x1c, 0x0a, 0x09, 0x6c,
|
||||
0x6f, 0x61, 0x64, 0x61, 0x76, 0x67, 0x31, 0x35, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x61, 0x76, 0x67, 0x31, 0x35, 0x2a, 0x30, 0x0a, 0x05, 0x53, 0x74, 0x61,
|
||||
0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12,
|
||||
0x0b, 0x0a, 0x07, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09,
|
||||
0x55, 0x4e, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x44, 0x10, 0x02, 0x32, 0x9e, 0x03, 0x0a, 0x06,
|
||||
0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x12, 0x43, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61,
|
||||
0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0c, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40,
|
||||
0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x16, 0x2e,
|
||||
0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x12, 0x48, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75,
|
||||
0x73, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x6f, 0x72, 0x74,
|
||||
0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x52, 0x75,
|
||||
0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61,
|
||||
0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
|
||||
0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x43,
|
||||
0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c,
|
||||
0x2e, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x18, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61,
|
||||
0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2d, 0x5a, 0x2b,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x65, 0x65, 0x64,
|
||||
0x72, 0x75, 0x6e, 0x73, 0x68, 0x2f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x72, 0x75, 0x6e, 0x2f, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_portal_portal_proto_rawDescOnce sync.Once
|
||||
file_portal_portal_proto_rawDescData = file_portal_portal_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_portal_portal_proto_rawDescGZIP() []byte {
|
||||
file_portal_portal_proto_rawDescOnce.Do(func() {
|
||||
file_portal_portal_proto_rawDescData = protoimpl.X.CompressGZIP(file_portal_portal_proto_rawDescData)
|
||||
})
|
||||
return file_portal_portal_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_portal_portal_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_portal_portal_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_portal_portal_proto_goTypes = []interface{}{
|
||||
(State)(0), // 0: portal.State
|
||||
(*CommandRequest)(nil), // 1: portal.CommandRequest
|
||||
(*CommandResponse)(nil), // 2: portal.CommandResponse
|
||||
(*ServiceRequest)(nil), // 3: portal.ServiceRequest
|
||||
(*ServiceResponse)(nil), // 4: portal.ServiceResponse
|
||||
(*ServiceStatusResponse)(nil), // 5: portal.ServiceStatusResponse
|
||||
(*CPUusageRequest)(nil), // 6: portal.CPUusageRequest
|
||||
(*CPUusageResponse)(nil), // 7: portal.CPUusageResponse
|
||||
}
|
||||
var file_portal_portal_proto_depIdxs = []int32{
|
||||
0, // 0: portal.CommandResponse.state:type_name -> portal.State
|
||||
0, // 1: portal.ServiceResponse.state:type_name -> portal.State
|
||||
0, // 2: portal.ServiceStatusResponse.state:type_name -> portal.State
|
||||
3, // 3: portal.Portal.ServiceRestart:input_type -> portal.ServiceRequest
|
||||
3, // 4: portal.Portal.ServiceStart:input_type -> portal.ServiceRequest
|
||||
3, // 5: portal.Portal.ServiceStop:input_type -> portal.ServiceRequest
|
||||
3, // 6: portal.Portal.ServiceStatus:input_type -> portal.ServiceRequest
|
||||
1, // 7: portal.Portal.RunCommand:input_type -> portal.CommandRequest
|
||||
6, // 8: portal.Portal.CPUusage:input_type -> portal.CPUusageRequest
|
||||
4, // 9: portal.Portal.ServiceRestart:output_type -> portal.ServiceResponse
|
||||
4, // 10: portal.Portal.ServiceStart:output_type -> portal.ServiceResponse
|
||||
4, // 11: portal.Portal.ServiceStop:output_type -> portal.ServiceResponse
|
||||
5, // 12: portal.Portal.ServiceStatus:output_type -> portal.ServiceStatusResponse
|
||||
2, // 13: portal.Portal.RunCommand:output_type -> portal.CommandResponse
|
||||
7, // 14: portal.Portal.CPUusage:output_type -> portal.CPUusageResponse
|
||||
9, // [9:15] is the sub-list for method output_type
|
||||
3, // [3:9] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_portal_portal_proto_init() }
|
||||
func file_portal_portal_proto_init() {
|
||||
if File_portal_portal_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_portal_portal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CommandRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_portal_portal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CommandResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_portal_portal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ServiceRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_portal_portal_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ServiceResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_portal_portal_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ServiceStatusResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_portal_portal_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CPUusageRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_portal_portal_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CPUusageResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_portal_portal_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_portal_portal_proto_goTypes,
|
||||
DependencyIndexes: file_portal_portal_proto_depIdxs,
|
||||
EnumInfos: file_portal_portal_proto_enumTypes,
|
||||
MessageInfos: file_portal_portal_proto_msgTypes,
|
||||
}.Build()
|
||||
File_portal_portal_proto = out.File
|
||||
file_portal_portal_proto_rawDesc = nil
|
||||
file_portal_portal_proto_goTypes = nil
|
||||
file_portal_portal_proto_depIdxs = nil
|
||||
}
|
||||
56
proto/portal/portal.proto
Normal file
56
proto/portal/portal.proto
Normal file
@@ -0,0 +1,56 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "github.com/speedrunsh/speedrun/proto/portal";
|
||||
package portal;
|
||||
|
||||
enum State {
|
||||
UNKNOWN = 0;
|
||||
CHANGED = 1;
|
||||
UNCHANGED = 2;
|
||||
}
|
||||
|
||||
message CommandRequest {
|
||||
string name = 1;
|
||||
repeated string args = 2;
|
||||
}
|
||||
|
||||
message CommandResponse {
|
||||
State state = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message ServiceRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message ServiceResponse {
|
||||
State state = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message ServiceStatusResponse {
|
||||
State state = 1;
|
||||
string loadstate = 2;
|
||||
string activestate = 3;
|
||||
string substate = 4;
|
||||
}
|
||||
|
||||
message CPUusageRequest {}
|
||||
|
||||
message CPUusageResponse {
|
||||
int32 loadavg1 = 1;
|
||||
int32 loadavg5 = 2;
|
||||
int32 loadavg15 = 3;
|
||||
}
|
||||
|
||||
service Portal {
|
||||
rpc ServiceRestart(ServiceRequest) returns (ServiceResponse) {}
|
||||
rpc ServiceStart(ServiceRequest) returns (ServiceResponse) {}
|
||||
rpc ServiceStop(ServiceRequest) returns (ServiceResponse) {}
|
||||
rpc ServiceStatus(ServiceRequest) returns (ServiceStatusResponse) {}
|
||||
rpc RunCommand(CommandRequest) returns (CommandResponse) {}
|
||||
rpc CPUusage(CPUusageRequest) returns (CPUusageResponse) {
|
||||
} // --target group1 --target group2
|
||||
// rpc CPUProfile(CPUProfileRequest) returns (CPUProfileResponse) {}
|
||||
// rpc MemProfile(MemProfileRequest) returns (MemProfileResponse) {}
|
||||
// rpc EnsureMountedDisk()
|
||||
}
|
||||
311
proto/portal/portal_drpc.pb.go
Normal file
311
proto/portal/portal_drpc.pb.go
Normal file
@@ -0,0 +1,311 @@
|
||||
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
||||
// protoc-gen-go-drpc version: v0.0.26
|
||||
// source: portal/portal.proto
|
||||
|
||||
package portal
|
||||
|
||||
import (
|
||||
context "context"
|
||||
errors "errors"
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
drpc "storj.io/drpc"
|
||||
drpcerr "storj.io/drpc/drpcerr"
|
||||
)
|
||||
|
||||
type drpcEncoding_File_portal_portal_proto struct{}
|
||||
|
||||
func (drpcEncoding_File_portal_portal_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
||||
return proto.Marshal(msg.(proto.Message))
|
||||
}
|
||||
|
||||
func (drpcEncoding_File_portal_portal_proto) MarshalAppend(buf []byte, msg drpc.Message) ([]byte, error) {
|
||||
return proto.MarshalOptions{}.MarshalAppend(buf, msg.(proto.Message))
|
||||
}
|
||||
|
||||
func (drpcEncoding_File_portal_portal_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
||||
return proto.Unmarshal(buf, msg.(proto.Message))
|
||||
}
|
||||
|
||||
func (drpcEncoding_File_portal_portal_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
|
||||
return protojson.Marshal(msg.(proto.Message))
|
||||
}
|
||||
|
||||
func (drpcEncoding_File_portal_portal_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
|
||||
return protojson.Unmarshal(buf, msg.(proto.Message))
|
||||
}
|
||||
|
||||
type DRPCPortalClient interface {
|
||||
DRPCConn() drpc.Conn
|
||||
|
||||
ServiceRestart(ctx context.Context, in *ServiceRequest) (*ServiceResponse, error)
|
||||
ServiceStart(ctx context.Context, in *ServiceRequest) (*ServiceResponse, error)
|
||||
ServiceStop(ctx context.Context, in *ServiceRequest) (*ServiceResponse, error)
|
||||
ServiceStatus(ctx context.Context, in *ServiceRequest) (*ServiceStatusResponse, error)
|
||||
RunCommand(ctx context.Context, in *CommandRequest) (*CommandResponse, error)
|
||||
CPUusage(ctx context.Context, in *CPUusageRequest) (*CPUusageResponse, error)
|
||||
}
|
||||
|
||||
type drpcPortalClient struct {
|
||||
cc drpc.Conn
|
||||
}
|
||||
|
||||
func NewDRPCPortalClient(cc drpc.Conn) DRPCPortalClient {
|
||||
return &drpcPortalClient{cc}
|
||||
}
|
||||
|
||||
func (c *drpcPortalClient) DRPCConn() drpc.Conn { return c.cc }
|
||||
|
||||
func (c *drpcPortalClient) ServiceRestart(ctx context.Context, in *ServiceRequest) (*ServiceResponse, error) {
|
||||
out := new(ServiceResponse)
|
||||
err := c.cc.Invoke(ctx, "/portal.Portal/ServiceRestart", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *drpcPortalClient) ServiceStart(ctx context.Context, in *ServiceRequest) (*ServiceResponse, error) {
|
||||
out := new(ServiceResponse)
|
||||
err := c.cc.Invoke(ctx, "/portal.Portal/ServiceStart", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *drpcPortalClient) ServiceStop(ctx context.Context, in *ServiceRequest) (*ServiceResponse, error) {
|
||||
out := new(ServiceResponse)
|
||||
err := c.cc.Invoke(ctx, "/portal.Portal/ServiceStop", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *drpcPortalClient) ServiceStatus(ctx context.Context, in *ServiceRequest) (*ServiceStatusResponse, error) {
|
||||
out := new(ServiceStatusResponse)
|
||||
err := c.cc.Invoke(ctx, "/portal.Portal/ServiceStatus", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *drpcPortalClient) RunCommand(ctx context.Context, in *CommandRequest) (*CommandResponse, error) {
|
||||
out := new(CommandResponse)
|
||||
err := c.cc.Invoke(ctx, "/portal.Portal/RunCommand", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *drpcPortalClient) CPUusage(ctx context.Context, in *CPUusageRequest) (*CPUusageResponse, error) {
|
||||
out := new(CPUusageResponse)
|
||||
err := c.cc.Invoke(ctx, "/portal.Portal/CPUusage", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type DRPCPortalServer interface {
|
||||
ServiceRestart(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
||||
ServiceStart(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
||||
ServiceStop(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
||||
ServiceStatus(context.Context, *ServiceRequest) (*ServiceStatusResponse, error)
|
||||
RunCommand(context.Context, *CommandRequest) (*CommandResponse, error)
|
||||
CPUusage(context.Context, *CPUusageRequest) (*CPUusageResponse, error)
|
||||
}
|
||||
|
||||
type DRPCPortalUnimplementedServer struct{}
|
||||
|
||||
func (s *DRPCPortalUnimplementedServer) ServiceRestart(context.Context, *ServiceRequest) (*ServiceResponse, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
func (s *DRPCPortalUnimplementedServer) ServiceStart(context.Context, *ServiceRequest) (*ServiceResponse, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
func (s *DRPCPortalUnimplementedServer) ServiceStop(context.Context, *ServiceRequest) (*ServiceResponse, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
func (s *DRPCPortalUnimplementedServer) ServiceStatus(context.Context, *ServiceRequest) (*ServiceStatusResponse, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
func (s *DRPCPortalUnimplementedServer) RunCommand(context.Context, *CommandRequest) (*CommandResponse, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
func (s *DRPCPortalUnimplementedServer) CPUusage(context.Context, *CPUusageRequest) (*CPUusageResponse, error) {
|
||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||
}
|
||||
|
||||
type DRPCPortalDescription struct{}
|
||||
|
||||
func (DRPCPortalDescription) NumMethods() int { return 6 }
|
||||
|
||||
func (DRPCPortalDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
||||
switch n {
|
||||
case 0:
|
||||
return "/portal.Portal/ServiceRestart", drpcEncoding_File_portal_portal_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCPortalServer).
|
||||
ServiceRestart(
|
||||
ctx,
|
||||
in1.(*ServiceRequest),
|
||||
)
|
||||
}, DRPCPortalServer.ServiceRestart, true
|
||||
case 1:
|
||||
return "/portal.Portal/ServiceStart", drpcEncoding_File_portal_portal_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCPortalServer).
|
||||
ServiceStart(
|
||||
ctx,
|
||||
in1.(*ServiceRequest),
|
||||
)
|
||||
}, DRPCPortalServer.ServiceStart, true
|
||||
case 2:
|
||||
return "/portal.Portal/ServiceStop", drpcEncoding_File_portal_portal_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCPortalServer).
|
||||
ServiceStop(
|
||||
ctx,
|
||||
in1.(*ServiceRequest),
|
||||
)
|
||||
}, DRPCPortalServer.ServiceStop, true
|
||||
case 3:
|
||||
return "/portal.Portal/ServiceStatus", drpcEncoding_File_portal_portal_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCPortalServer).
|
||||
ServiceStatus(
|
||||
ctx,
|
||||
in1.(*ServiceRequest),
|
||||
)
|
||||
}, DRPCPortalServer.ServiceStatus, true
|
||||
case 4:
|
||||
return "/portal.Portal/RunCommand", drpcEncoding_File_portal_portal_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCPortalServer).
|
||||
RunCommand(
|
||||
ctx,
|
||||
in1.(*CommandRequest),
|
||||
)
|
||||
}, DRPCPortalServer.RunCommand, true
|
||||
case 5:
|
||||
return "/portal.Portal/CPUusage", drpcEncoding_File_portal_portal_proto{},
|
||||
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||
return srv.(DRPCPortalServer).
|
||||
CPUusage(
|
||||
ctx,
|
||||
in1.(*CPUusageRequest),
|
||||
)
|
||||
}, DRPCPortalServer.CPUusage, true
|
||||
default:
|
||||
return "", nil, nil, nil, false
|
||||
}
|
||||
}
|
||||
|
||||
func DRPCRegisterPortal(mux drpc.Mux, impl DRPCPortalServer) error {
|
||||
return mux.Register(impl, DRPCPortalDescription{})
|
||||
}
|
||||
|
||||
type DRPCPortal_ServiceRestartStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*ServiceResponse) error
|
||||
}
|
||||
|
||||
type drpcPortal_ServiceRestartStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcPortal_ServiceRestartStream) SendAndClose(m *ServiceResponse) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_portal_portal_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
||||
|
||||
type DRPCPortal_ServiceStartStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*ServiceResponse) error
|
||||
}
|
||||
|
||||
type drpcPortal_ServiceStartStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcPortal_ServiceStartStream) SendAndClose(m *ServiceResponse) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_portal_portal_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
||||
|
||||
type DRPCPortal_ServiceStopStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*ServiceResponse) error
|
||||
}
|
||||
|
||||
type drpcPortal_ServiceStopStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcPortal_ServiceStopStream) SendAndClose(m *ServiceResponse) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_portal_portal_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
||||
|
||||
type DRPCPortal_ServiceStatusStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*ServiceStatusResponse) error
|
||||
}
|
||||
|
||||
type drpcPortal_ServiceStatusStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcPortal_ServiceStatusStream) SendAndClose(m *ServiceStatusResponse) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_portal_portal_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
||||
|
||||
type DRPCPortal_RunCommandStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*CommandResponse) error
|
||||
}
|
||||
|
||||
type drpcPortal_RunCommandStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcPortal_RunCommandStream) SendAndClose(m *CommandResponse) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_portal_portal_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
||||
|
||||
type DRPCPortal_CPUusageStream interface {
|
||||
drpc.Stream
|
||||
SendAndClose(*CPUusageResponse) error
|
||||
}
|
||||
|
||||
type drpcPortal_CPUusageStream struct {
|
||||
drpc.Stream
|
||||
}
|
||||
|
||||
func (x *drpcPortal_CPUusageStream) SendAndClose(m *CPUusageResponse) error {
|
||||
if err := x.MsgSend(m, drpcEncoding_File_portal_portal_proto{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.CloseSend()
|
||||
}
|
||||
Reference in New Issue
Block a user