Add system shutdown subcommand
This commit is contained in:
1 parent
7b1565e6a4
commit
2d078228c9
5 files changed
+299
-84
No files matched your search
@@ -26,15 +26,24 @@ var rebootCmd = &cobra.Command{
|
|||||||
Short: "Reboot the system",
|
Short: "Reboot the system",
|
||||||
Example: " speedrun system reboot",
|
Example: " speedrun system reboot",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
RunE: reboot,
|
RunE: systemAction,
|
||||||
|
}
|
||||||
|
|
||||||
|
var shutdownCmd = &cobra.Command{
|
||||||
|
Use: "shutdown",
|
||||||
|
Short: "Shutdown the system",
|
||||||
|
Example: " speedrun system shutdown",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
RunE: systemAction,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
systemCmd.SetUsageTemplate(usage)
|
systemCmd.SetUsageTemplate(usage)
|
||||||
systemCmd.AddCommand(rebootCmd)
|
systemCmd.AddCommand(rebootCmd)
|
||||||
|
systemCmd.AddCommand(shutdownCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func reboot(cmd *cobra.Command, _ []string) error {
|
func systemAction(cmd *cobra.Command, _ []string) error {
|
||||||
usePrivateIP := viper.GetBool("portal.use-private-ip")
|
usePrivateIP := viper.GetBool("portal.use-private-ip")
|
||||||
|
|
||||||
tlsConfig, err := cloud.SetupTLS()
|
tlsConfig, err := cloud.SetupTLS()
|
||||||
@@ -76,13 +85,23 @@ func reboot(cmd *cobra.Command, _ []string) error {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
r, err := c.SystemReboot(ctx, &portalpb.SystemRebootRequest{})
|
switch cmd.Name() {
|
||||||
if err != nil {
|
case "reboot":
|
||||||
log.Error(err.Error())
|
r, err := c.SystemReboot(ctx, &portalpb.SystemRebootRequest{})
|
||||||
return
|
if err != nil {
|
||||||
}
|
log.Error(err.Error())
|
||||||
log.WithField("state", r.GetState()).Infof(r.GetMessage())
|
return
|
||||||
|
}
|
||||||
|
log.WithField("state", r.GetState()).Infof(r.GetMessage())
|
||||||
|
|
||||||
|
case "shutdown":
|
||||||
|
r, err := c.SystemShutdown(ctx, &portalpb.SystemShutdownRequest{})
|
||||||
|
if err != nil {
|
||||||
|
log.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.WithField("state", r.GetState()).Infof(r.GetMessage())
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
pool.StopAndWait()
|
pool.StopAndWait()
|
||||||
|
|||||||
@@ -23,3 +23,17 @@ func (s *Server) SystemReboot(ctx context.Context, system *portal.SystemRebootRe
|
|||||||
|
|
||||||
return &portal.SystemRebootResponse{State: portal.State_CHANGED, Message: "Rebooting"}, nil
|
return &portal.SystemRebootResponse{State: portal.State_CHANGED, Message: "Rebooting"}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) SystemShutdown(ctx context.Context, system *portal.SystemShutdownRequest) (*portal.SystemShutdownResponse, error) {
|
||||||
|
fields := log.Fields{
|
||||||
|
"context": "system",
|
||||||
|
"command": "shutdown",
|
||||||
|
}
|
||||||
|
log := log.WithFields(fields)
|
||||||
|
log.Debug("Received system shutdown request")
|
||||||
|
|
||||||
|
syscall.Sync()
|
||||||
|
go syscall.Reboot(syscall.LINUX_REBOOT_CMD_POWER_OFF)
|
||||||
|
|
||||||
|
return &portal.SystemShutdownResponse{State: portal.State_CHANGED, Message: "Shutting down"}, nil
|
||||||
|
}
|
||||||
+209
-75
@@ -648,6 +648,99 @@ func (x *SystemRebootResponse) GetMessage() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SystemShutdownRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SystemShutdownRequest) Reset() {
|
||||||
|
*x = SystemShutdownRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_portal_portal_proto_msgTypes[11]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SystemShutdownRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SystemShutdownRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SystemShutdownRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_portal_portal_proto_msgTypes[11]
|
||||||
|
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 SystemShutdownRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SystemShutdownRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_portal_portal_proto_rawDescGZIP(), []int{11}
|
||||||
|
}
|
||||||
|
|
||||||
|
type SystemShutdownResponse 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 *SystemShutdownResponse) Reset() {
|
||||||
|
*x = SystemShutdownResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_portal_portal_proto_msgTypes[12]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SystemShutdownResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SystemShutdownResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SystemShutdownResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_portal_portal_proto_msgTypes[12]
|
||||||
|
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 SystemShutdownResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SystemShutdownResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_portal_portal_proto_rawDescGZIP(), []int{12}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SystemShutdownResponse) GetState() State {
|
||||||
|
if x != nil {
|
||||||
|
return x.State
|
||||||
|
}
|
||||||
|
return State_UNKNOWN
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SystemShutdownResponse) GetMessage() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Message
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_portal_portal_proto protoreflect.FileDescriptor
|
var File_portal_portal_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_portal_portal_proto_rawDesc = []byte{
|
var file_portal_portal_proto_rawDesc = []byte{
|
||||||
@@ -701,48 +794,60 @@ var file_portal_portal_proto_rawDesc = []byte{
|
|||||||
0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65,
|
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,
|
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,
|
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
0x65, 0x2a, 0x30, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e,
|
0x65, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x75, 0x74, 0x64,
|
||||||
0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x48, 0x41, 0x4e, 0x47,
|
0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x57, 0x0a, 0x16, 0x53, 0x79,
|
||||||
0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45,
|
0x73, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70,
|
||||||
0x44, 0x10, 0x02, 0x32, 0xac, 0x04, 0x0a, 0x06, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x12, 0x43,
|
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20,
|
||||||
0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74,
|
0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61,
|
||||||
0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
|
||||||
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61,
|
0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||||
0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x61, 0x67, 0x65, 0x2a, 0x30, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07,
|
||||||
0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74,
|
0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x48, 0x41,
|
||||||
0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72,
|
0x4e, 0x47, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x43, 0x48, 0x41, 0x4e,
|
||||||
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x6f,
|
0x47, 0x45, 0x44, 0x10, 0x02, 0x32, 0xff, 0x04, 0x0a, 0x06, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c,
|
||||||
0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70,
|
0x12, 0x43, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x74, 0x61,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
0x72, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76,
|
||||||
0x65, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53,
|
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,
|
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,
|
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,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76,
|
||||||
0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74,
|
0x69, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c,
|
||||||
0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0d, 0x53, 0x65,
|
||||||
0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x6f,
|
||||||
0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
|
0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61,
|
0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72,
|
||||||
0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12,
|
0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
|
||||||
0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67,
|
0x6e, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
|
||||||
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61,
|
0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x6f, 0x72,
|
||||||
0x6c, 0x2e, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x74, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x64,
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67,
|
||||||
0x12, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65,
|
0x65, 0x12, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x43, 0x50, 0x55, 0x75, 0x73,
|
||||||
0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x6f, 0x72, 0x74,
|
0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x6f, 0x72,
|
||||||
0x61, 0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x74, 0x61, 0x6c, 0x2e, 0x43, 0x50, 0x55, 0x75, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52,
|
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65,
|
||||||
0x65, 0x62, 0x6f, 0x6f, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53,
|
0x61, 0x64, 0x12, 0x17, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x65,
|
||||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x6f,
|
||||||
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x79, 0x73, 0x74,
|
0x72, 0x74, 0x61, 0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73,
|
||||||
0x65, 0x6d, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||||
0x22, 0x00, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
0x6d, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c,
|
||||||
0x2f, 0x64, 0x70, 0x6f, 0x67, 0x6f, 0x72, 0x7a, 0x65, 0x6c, 0x73, 0x6b, 0x69, 0x2f, 0x73, 0x70,
|
0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71,
|
||||||
0x65, 0x65, 0x64, 0x72, 0x75, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6f, 0x72,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53, 0x79,
|
||||||
0x74, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x73, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
|
0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x68,
|
||||||
|
0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e,
|
||||||
|
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x53,
|
||||||
|
0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||||
|
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x70, 0x6f, 0x67, 0x6f, 0x72, 0x7a, 0x65, 0x6c, 0x73,
|
||||||
|
0x6b, 0x69, 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 (
|
var (
|
||||||
@@ -758,20 +863,22 @@ func file_portal_portal_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_portal_portal_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_portal_portal_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_portal_portal_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
var file_portal_portal_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||||
var file_portal_portal_proto_goTypes = []interface{}{
|
var file_portal_portal_proto_goTypes = []interface{}{
|
||||||
(State)(0), // 0: portal.State
|
(State)(0), // 0: portal.State
|
||||||
(*CommandRequest)(nil), // 1: portal.CommandRequest
|
(*CommandRequest)(nil), // 1: portal.CommandRequest
|
||||||
(*CommandResponse)(nil), // 2: portal.CommandResponse
|
(*CommandResponse)(nil), // 2: portal.CommandResponse
|
||||||
(*ServiceRequest)(nil), // 3: portal.ServiceRequest
|
(*ServiceRequest)(nil), // 3: portal.ServiceRequest
|
||||||
(*ServiceResponse)(nil), // 4: portal.ServiceResponse
|
(*ServiceResponse)(nil), // 4: portal.ServiceResponse
|
||||||
(*ServiceStatusResponse)(nil), // 5: portal.ServiceStatusResponse
|
(*ServiceStatusResponse)(nil), // 5: portal.ServiceStatusResponse
|
||||||
(*CPUusageRequest)(nil), // 6: portal.CPUusageRequest
|
(*CPUusageRequest)(nil), // 6: portal.CPUusageRequest
|
||||||
(*CPUusageResponse)(nil), // 7: portal.CPUusageResponse
|
(*CPUusageResponse)(nil), // 7: portal.CPUusageResponse
|
||||||
(*FileReadRequest)(nil), // 8: portal.FileReadRequest
|
(*FileReadRequest)(nil), // 8: portal.FileReadRequest
|
||||||
(*FileReadResponse)(nil), // 9: portal.FileReadResponse
|
(*FileReadResponse)(nil), // 9: portal.FileReadResponse
|
||||||
(*SystemRebootRequest)(nil), // 10: portal.SystemRebootRequest
|
(*SystemRebootRequest)(nil), // 10: portal.SystemRebootRequest
|
||||||
(*SystemRebootResponse)(nil), // 11: portal.SystemRebootResponse
|
(*SystemRebootResponse)(nil), // 11: portal.SystemRebootResponse
|
||||||
|
(*SystemShutdownRequest)(nil), // 12: portal.SystemShutdownRequest
|
||||||
|
(*SystemShutdownResponse)(nil), // 13: portal.SystemShutdownResponse
|
||||||
}
|
}
|
||||||
var file_portal_portal_proto_depIdxs = []int32{
|
var file_portal_portal_proto_depIdxs = []int32{
|
||||||
0, // 0: portal.CommandResponse.state:type_name -> portal.State
|
0, // 0: portal.CommandResponse.state:type_name -> portal.State
|
||||||
@@ -779,27 +886,30 @@ var file_portal_portal_proto_depIdxs = []int32{
|
|||||||
0, // 2: portal.ServiceStatusResponse.state:type_name -> portal.State
|
0, // 2: portal.ServiceStatusResponse.state:type_name -> portal.State
|
||||||
0, // 3: portal.FileReadResponse.state:type_name -> portal.State
|
0, // 3: portal.FileReadResponse.state:type_name -> portal.State
|
||||||
0, // 4: portal.SystemRebootResponse.state:type_name -> portal.State
|
0, // 4: portal.SystemRebootResponse.state:type_name -> portal.State
|
||||||
3, // 5: portal.Portal.ServiceRestart:input_type -> portal.ServiceRequest
|
0, // 5: portal.SystemShutdownResponse.state:type_name -> portal.State
|
||||||
3, // 6: portal.Portal.ServiceStart:input_type -> portal.ServiceRequest
|
3, // 6: portal.Portal.ServiceRestart:input_type -> portal.ServiceRequest
|
||||||
3, // 7: portal.Portal.ServiceStop:input_type -> portal.ServiceRequest
|
3, // 7: portal.Portal.ServiceStart:input_type -> portal.ServiceRequest
|
||||||
3, // 8: portal.Portal.ServiceStatus:input_type -> portal.ServiceRequest
|
3, // 8: portal.Portal.ServiceStop:input_type -> portal.ServiceRequest
|
||||||
1, // 9: portal.Portal.RunCommand:input_type -> portal.CommandRequest
|
3, // 9: portal.Portal.ServiceStatus:input_type -> portal.ServiceRequest
|
||||||
6, // 10: portal.Portal.CPUusage:input_type -> portal.CPUusageRequest
|
1, // 10: portal.Portal.RunCommand:input_type -> portal.CommandRequest
|
||||||
8, // 11: portal.Portal.FileRead:input_type -> portal.FileReadRequest
|
6, // 11: portal.Portal.CPUusage:input_type -> portal.CPUusageRequest
|
||||||
10, // 12: portal.Portal.SystemReboot:input_type -> portal.SystemRebootRequest
|
8, // 12: portal.Portal.FileRead:input_type -> portal.FileReadRequest
|
||||||
4, // 13: portal.Portal.ServiceRestart:output_type -> portal.ServiceResponse
|
10, // 13: portal.Portal.SystemReboot:input_type -> portal.SystemRebootRequest
|
||||||
4, // 14: portal.Portal.ServiceStart:output_type -> portal.ServiceResponse
|
12, // 14: portal.Portal.SystemShutdown:input_type -> portal.SystemShutdownRequest
|
||||||
4, // 15: portal.Portal.ServiceStop:output_type -> portal.ServiceResponse
|
4, // 15: portal.Portal.ServiceRestart:output_type -> portal.ServiceResponse
|
||||||
5, // 16: portal.Portal.ServiceStatus:output_type -> portal.ServiceStatusResponse
|
4, // 16: portal.Portal.ServiceStart:output_type -> portal.ServiceResponse
|
||||||
2, // 17: portal.Portal.RunCommand:output_type -> portal.CommandResponse
|
4, // 17: portal.Portal.ServiceStop:output_type -> portal.ServiceResponse
|
||||||
7, // 18: portal.Portal.CPUusage:output_type -> portal.CPUusageResponse
|
5, // 18: portal.Portal.ServiceStatus:output_type -> portal.ServiceStatusResponse
|
||||||
9, // 19: portal.Portal.FileRead:output_type -> portal.FileReadResponse
|
2, // 19: portal.Portal.RunCommand:output_type -> portal.CommandResponse
|
||||||
11, // 20: portal.Portal.SystemReboot:output_type -> portal.SystemRebootResponse
|
7, // 20: portal.Portal.CPUusage:output_type -> portal.CPUusageResponse
|
||||||
13, // [13:21] is the sub-list for method output_type
|
9, // 21: portal.Portal.FileRead:output_type -> portal.FileReadResponse
|
||||||
5, // [5:13] is the sub-list for method input_type
|
11, // 22: portal.Portal.SystemReboot:output_type -> portal.SystemRebootResponse
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
13, // 23: portal.Portal.SystemShutdown:output_type -> portal.SystemShutdownResponse
|
||||||
5, // [5:5] is the sub-list for extension extendee
|
15, // [15:24] is the sub-list for method output_type
|
||||||
0, // [0:5] is the sub-list for field type_name
|
6, // [6:15] is the sub-list for method input_type
|
||||||
|
6, // [6:6] is the sub-list for extension type_name
|
||||||
|
6, // [6:6] is the sub-list for extension extendee
|
||||||
|
0, // [0:6] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_portal_portal_proto_init() }
|
func init() { file_portal_portal_proto_init() }
|
||||||
@@ -940,6 +1050,30 @@ func file_portal_portal_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_portal_portal_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SystemShutdownRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_portal_portal_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SystemShutdownResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@@ -947,7 +1081,7 @@ func file_portal_portal_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_portal_portal_proto_rawDesc,
|
RawDescriptor: file_portal_portal_proto_rawDesc,
|
||||||
NumEnums: 1,
|
NumEnums: 1,
|
||||||
NumMessages: 11,
|
NumMessages: 13,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ message SystemRebootResponse {
|
|||||||
string message = 2;
|
string message = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message SystemShutdownRequest {}
|
||||||
|
|
||||||
|
message SystemShutdownResponse {
|
||||||
|
State state = 1;
|
||||||
|
string message = 2;
|
||||||
|
}
|
||||||
|
|
||||||
service Portal {
|
service Portal {
|
||||||
rpc ServiceRestart(ServiceRequest) returns (ServiceResponse) {}
|
rpc ServiceRestart(ServiceRequest) returns (ServiceResponse) {}
|
||||||
rpc ServiceStart(ServiceRequest) returns (ServiceResponse) {}
|
rpc ServiceStart(ServiceRequest) returns (ServiceResponse) {}
|
||||||
@@ -67,6 +74,7 @@ service Portal {
|
|||||||
rpc CPUusage(CPUusageRequest) returns (CPUusageResponse) {}
|
rpc CPUusage(CPUusageRequest) returns (CPUusageResponse) {}
|
||||||
rpc FileRead(FileReadRequest) returns (FileReadResponse) {}
|
rpc FileRead(FileReadRequest) returns (FileReadResponse) {}
|
||||||
rpc SystemReboot(SystemRebootRequest) returns (SystemRebootResponse) {}
|
rpc SystemReboot(SystemRebootRequest) returns (SystemRebootResponse) {}
|
||||||
|
rpc SystemShutdown(SystemShutdownRequest) returns (SystemShutdownResponse) {}
|
||||||
// --target group1 --target group2
|
// --target group1 --target group2
|
||||||
// rpc CPUProfile(CPUProfileRequest) returns (CPUProfileResponse) {}
|
// rpc CPUProfile(CPUProfileRequest) returns (CPUProfileResponse) {}
|
||||||
// rpc MemProfile(MemProfileRequest) returns (MemProfileResponse) {}
|
// rpc MemProfile(MemProfileRequest) returns (MemProfileResponse) {}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ type DRPCPortalClient interface {
|
|||||||
CPUusage(ctx context.Context, in *CPUusageRequest) (*CPUusageResponse, error)
|
CPUusage(ctx context.Context, in *CPUusageRequest) (*CPUusageResponse, error)
|
||||||
FileRead(ctx context.Context, in *FileReadRequest) (*FileReadResponse, error)
|
FileRead(ctx context.Context, in *FileReadRequest) (*FileReadResponse, error)
|
||||||
SystemReboot(ctx context.Context, in *SystemRebootRequest) (*SystemRebootResponse, error)
|
SystemReboot(ctx context.Context, in *SystemRebootRequest) (*SystemRebootResponse, error)
|
||||||
|
SystemShutdown(ctx context.Context, in *SystemShutdownRequest) (*SystemShutdownResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type drpcPortalClient struct {
|
type drpcPortalClient struct {
|
||||||
@@ -130,6 +131,15 @@ func (c *drpcPortalClient) SystemReboot(ctx context.Context, in *SystemRebootReq
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *drpcPortalClient) SystemShutdown(ctx context.Context, in *SystemShutdownRequest) (*SystemShutdownResponse, error) {
|
||||||
|
out := new(SystemShutdownResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/portal.Portal/SystemShutdown", drpcEncoding_File_portal_portal_proto{}, in, out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
type DRPCPortalServer interface {
|
type DRPCPortalServer interface {
|
||||||
ServiceRestart(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
ServiceRestart(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
||||||
ServiceStart(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
ServiceStart(context.Context, *ServiceRequest) (*ServiceResponse, error)
|
||||||
@@ -139,6 +149,7 @@ type DRPCPortalServer interface {
|
|||||||
CPUusage(context.Context, *CPUusageRequest) (*CPUusageResponse, error)
|
CPUusage(context.Context, *CPUusageRequest) (*CPUusageResponse, error)
|
||||||
FileRead(context.Context, *FileReadRequest) (*FileReadResponse, error)
|
FileRead(context.Context, *FileReadRequest) (*FileReadResponse, error)
|
||||||
SystemReboot(context.Context, *SystemRebootRequest) (*SystemRebootResponse, error)
|
SystemReboot(context.Context, *SystemRebootRequest) (*SystemRebootResponse, error)
|
||||||
|
SystemShutdown(context.Context, *SystemShutdownRequest) (*SystemShutdownResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type DRPCPortalUnimplementedServer struct{}
|
type DRPCPortalUnimplementedServer struct{}
|
||||||
@@ -175,9 +186,13 @@ func (s *DRPCPortalUnimplementedServer) SystemReboot(context.Context, *SystemReb
|
|||||||
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *DRPCPortalUnimplementedServer) SystemShutdown(context.Context, *SystemShutdownRequest) (*SystemShutdownResponse, error) {
|
||||||
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
||||||
|
}
|
||||||
|
|
||||||
type DRPCPortalDescription struct{}
|
type DRPCPortalDescription struct{}
|
||||||
|
|
||||||
func (DRPCPortalDescription) NumMethods() int { return 8 }
|
func (DRPCPortalDescription) NumMethods() int { return 9 }
|
||||||
|
|
||||||
func (DRPCPortalDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
func (DRPCPortalDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
||||||
switch n {
|
switch n {
|
||||||
@@ -253,6 +268,15 @@ func (DRPCPortalDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver
|
|||||||
in1.(*SystemRebootRequest),
|
in1.(*SystemRebootRequest),
|
||||||
)
|
)
|
||||||
}, DRPCPortalServer.SystemReboot, true
|
}, DRPCPortalServer.SystemReboot, true
|
||||||
|
case 8:
|
||||||
|
return "/portal.Portal/SystemShutdown", drpcEncoding_File_portal_portal_proto{},
|
||||||
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
||||||
|
return srv.(DRPCPortalServer).
|
||||||
|
SystemShutdown(
|
||||||
|
ctx,
|
||||||
|
in1.(*SystemShutdownRequest),
|
||||||
|
)
|
||||||
|
}, DRPCPortalServer.SystemShutdown, true
|
||||||
default:
|
default:
|
||||||
return "", nil, nil, nil, false
|
return "", nil, nil, nil, false
|
||||||
}
|
}
|
||||||
@@ -389,3 +413,19 @@ func (x *drpcPortal_SystemRebootStream) SendAndClose(m *SystemRebootResponse) er
|
|||||||
}
|
}
|
||||||
return x.CloseSend()
|
return x.CloseSend()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DRPCPortal_SystemShutdownStream interface {
|
||||||
|
drpc.Stream
|
||||||
|
SendAndClose(*SystemShutdownResponse) error
|
||||||
|
}
|
||||||
|
|
||||||
|
type drpcPortal_SystemShutdownStream struct {
|
||||||
|
drpc.Stream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *drpcPortal_SystemShutdownStream) SendAndClose(m *SystemShutdownResponse) 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