Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterServiceManagerServer(s grpc.ServiceRegistrar, srv ServiceManagerServer)
- type Create
- func (*Create) Descriptor() ([]byte, []int)deprecated
- func (x *Create) GetCommand() string
- func (x *Create) GetEnv() map[string]string
- func (x *Create) GetExecTimeout() int64
- func (x *Create) GetName() string
- func (x *Create) GetProcessNum() int64
- func (x *Create) GetRemainAfterExit() bool
- func (x *Create) GetRestartSec() uint64
- func (x *Create) GetServiceNameInLogs() bool
- func (x *Create) GetTimeoutStopSec() uint64
- func (*Create) ProtoMessage()
- func (x *Create) ProtoReflect() protoreflect.Message
- func (x *Create) Reset()
- func (x *Create) String() string
- type List
- type Response
- type Service
- type ServiceManagerClient
- type ServiceManagerServer
- type Status
- func (*Status) Descriptor() ([]byte, []int)deprecated
- func (x *Status) GetCommand() string
- func (x *Status) GetCpuPercent() float32
- func (x *Status) GetMemoryUsage() uint64
- func (x *Status) GetPid() int32
- func (x *Status) GetStatus() *v1.Status
- func (*Status) ProtoMessage()
- func (x *Status) ProtoReflect() protoreflect.Message
- func (x *Status) Reset()
- func (x *Status) String() string
- type Statuses
- type UnimplementedServiceManagerServer
- func (UnimplementedServiceManagerServer) CreateService(context.Context, *Create) (*Response, error)
- func (UnimplementedServiceManagerServer) GetStatus(context.Context, *Service) (*Status, error)
- func (UnimplementedServiceManagerServer) GetStatuses(context.Context, *Service) (*Statuses, error)
- func (UnimplementedServiceManagerServer) ListServices(context.Context, *Service) (*List, error)
- func (UnimplementedServiceManagerServer) Restart(context.Context, *Service) (*Response, error)
- func (UnimplementedServiceManagerServer) Terminate(context.Context, *Service) (*Response, error)
- type UnsafeServiceManagerServer
Constants ¶
const ( ServiceManager_CreateService_FullMethodName = "/service.v1.ServiceManager/CreateService" ServiceManager_Terminate_FullMethodName = "/service.v1.ServiceManager/Terminate" ServiceManager_Restart_FullMethodName = "/service.v1.ServiceManager/Restart" ServiceManager_GetStatus_FullMethodName = "/service.v1.ServiceManager/GetStatus" ServiceManager_GetStatuses_FullMethodName = "/service.v1.ServiceManager/GetStatuses" ServiceManager_ListServices_FullMethodName = "/service.v1.ServiceManager/ListServices" )
Variables ¶
var File_service_v1_service_proto protoreflect.FileDescriptor
var File_service_v1_service_rpc_proto protoreflect.FileDescriptor
var ServiceManager_ServiceDesc = grpc.ServiceDesc{ ServiceName: "service.v1.ServiceManager", HandlerType: (*ServiceManagerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateService", Handler: _ServiceManager_CreateService_Handler, }, { MethodName: "Terminate", Handler: _ServiceManager_Terminate_Handler, }, { MethodName: "Restart", Handler: _ServiceManager_Restart_Handler, }, { MethodName: "GetStatus", Handler: _ServiceManager_GetStatus_Handler, }, { MethodName: "GetStatuses", Handler: _ServiceManager_GetStatuses_Handler, }, { MethodName: "ListServices", Handler: _ServiceManager_ListServices_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service/v1/service_rpc.proto", }
ServiceManager_ServiceDesc is the grpc.ServiceDesc for ServiceManager service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceManagerServer ¶
func RegisterServiceManagerServer(s grpc.ServiceRegistrar, srv ServiceManagerServer)
Types ¶
type Create ¶
type Create struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
ProcessNum int64 `protobuf:"varint,3,opt,name=process_num,json=processNum,proto3" json:"process_num,omitempty"`
ExecTimeout int64 `protobuf:"varint,4,opt,name=exec_timeout,json=execTimeout,proto3" json:"exec_timeout,omitempty"`
RemainAfterExit bool `protobuf:"varint,5,opt,name=remain_after_exit,json=remainAfterExit,proto3" json:"remain_after_exit,omitempty"`
Env map[string]string `` /* 133-byte string literal not displayed */
RestartSec uint64 `protobuf:"varint,7,opt,name=restart_sec,json=restartSec,proto3" json:"restart_sec,omitempty"`
// new in 2023.2
ServiceNameInLogs bool `protobuf:"varint,8,opt,name=service_name_in_logs,json=serviceNameInLogs,proto3" json:"service_name_in_logs,omitempty"`
TimeoutStopSec uint64 `protobuf:"varint,9,opt,name=timeout_stop_sec,json=timeoutStopSec,proto3" json:"timeout_stop_sec,omitempty"`
// contains filtered or unexported fields
}
func (*Create) Descriptor
deprecated
func (*Create) GetCommand ¶
func (*Create) GetExecTimeout ¶
func (*Create) GetProcessNum ¶
func (*Create) GetRemainAfterExit ¶
func (*Create) GetRestartSec ¶
func (*Create) GetServiceNameInLogs ¶
func (*Create) GetTimeoutStopSec ¶
func (*Create) ProtoMessage ¶
func (*Create) ProtoMessage()
func (*Create) ProtoReflect ¶
func (x *Create) ProtoReflect() protoreflect.Message
type List ¶
type List struct {
Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
// contains filtered or unexported fields
}
func (*List) Descriptor
deprecated
func (*List) GetServices ¶
func (*List) ProtoMessage ¶
func (*List) ProtoMessage()
func (*List) ProtoReflect ¶
func (x *List) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Ok bool `protobuf:"varint,2,opt,name=ok,proto3" json:"ok,omitempty"`
// contains filtered or unexported fields
}
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// contains filtered or unexported fields
}
func (*Service) Descriptor
deprecated
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) ProtoReflect ¶
func (x *Service) ProtoReflect() protoreflect.Message
type ServiceManagerClient ¶
type ServiceManagerClient interface {
CreateService(ctx context.Context, in *Create, opts ...grpc.CallOption) (*Response, error)
Terminate(ctx context.Context, in *Service, opts ...grpc.CallOption) (*Response, error)
Restart(ctx context.Context, in *Service, opts ...grpc.CallOption) (*Response, error)
GetStatus(ctx context.Context, in *Service, opts ...grpc.CallOption) (*Status, error)
GetStatuses(ctx context.Context, in *Service, opts ...grpc.CallOption) (*Statuses, error)
ListServices(ctx context.Context, in *Service, opts ...grpc.CallOption) (*List, error)
}
ServiceManagerClient is the client API for ServiceManager service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
ServiceManager exposes lifecycle and status RPCs for the service plugin. RPC method names are prefixed (CreateService, GetStatus, …) to avoid collisions with same-named messages in this package (Create, Status, …).
func NewServiceManagerClient ¶
func NewServiceManagerClient(cc grpc.ClientConnInterface) ServiceManagerClient
type ServiceManagerServer ¶
type ServiceManagerServer interface {
CreateService(context.Context, *Create) (*Response, error)
Terminate(context.Context, *Service) (*Response, error)
Restart(context.Context, *Service) (*Response, error)
GetStatus(context.Context, *Service) (*Status, error)
GetStatuses(context.Context, *Service) (*Statuses, error)
ListServices(context.Context, *Service) (*List, error)
// contains filtered or unexported methods
}
ServiceManagerServer is the server API for ServiceManager service. All implementations must embed UnimplementedServiceManagerServer for forward compatibility.
ServiceManager exposes lifecycle and status RPCs for the service plugin. RPC method names are prefixed (CreateService, GetStatus, …) to avoid collisions with same-named messages in this package (Create, Status, …).
type Status ¶
type Status struct {
CpuPercent float32 `protobuf:"fixed32,1,opt,name=cpu_percent,json=cpuPercent,proto3" json:"cpu_percent,omitempty"`
Pid int32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
MemoryUsage uint64 `protobuf:"varint,3,opt,name=memory_usage,json=memoryUsage,proto3" json:"memory_usage,omitempty"`
Command string `protobuf:"bytes,4,opt,name=command,proto3" json:"command,omitempty"`
// error state
Status *v1.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
// contains filtered or unexported fields
}
func (*Status) Descriptor
deprecated
func (*Status) GetCommand ¶
func (*Status) GetCpuPercent ¶
func (*Status) GetMemoryUsage ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type Statuses ¶
type Statuses struct {
Status []*Status `protobuf:"bytes,1,rep,name=status,proto3" json:"status,omitempty"`
// contains filtered or unexported fields
}
func (*Statuses) Descriptor
deprecated
func (*Statuses) ProtoMessage ¶
func (*Statuses) ProtoMessage()
func (*Statuses) ProtoReflect ¶
func (x *Statuses) ProtoReflect() protoreflect.Message
type UnimplementedServiceManagerServer ¶
type UnimplementedServiceManagerServer struct{}
UnimplementedServiceManagerServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedServiceManagerServer) CreateService ¶
func (UnimplementedServiceManagerServer) GetStatuses ¶
func (UnimplementedServiceManagerServer) ListServices ¶
type UnsafeServiceManagerServer ¶
type UnsafeServiceManagerServer interface {
// contains filtered or unexported methods
}
UnsafeServiceManagerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceManagerServer will result in compilation errors.