Documentation ¶
Overview ¶
Package service defines the RPC interface for the sansshell Service actions.
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Action
- type ActionManyResponse
- type ActionReply
- func (*ActionReply) Descriptor() ([]byte, []int)deprecated
- func (x *ActionReply) GetServiceName() string
- func (x *ActionReply) GetSystemType() SystemType
- func (*ActionReply) ProtoMessage()
- func (x *ActionReply) ProtoReflect() protoreflect.Message
- func (x *ActionReply) Reset()
- func (x *ActionReply) String() string
- type ActionRequest
- func (*ActionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ActionRequest) GetAction() Action
- func (x *ActionRequest) GetServiceName() string
- func (x *ActionRequest) GetSystemType() SystemType
- func (*ActionRequest) ProtoMessage()
- func (x *ActionRequest) ProtoReflect() protoreflect.Message
- func (x *ActionRequest) Reset()
- func (x *ActionRequest) String() string
- type ListManyResponse
- type ListReply
- func (*ListReply) Descriptor() ([]byte, []int)deprecated
- func (x *ListReply) GetServices() []*ServiceStatus
- func (x *ListReply) GetSystemType() SystemType
- func (*ListReply) ProtoMessage()
- func (x *ListReply) ProtoReflect() protoreflect.Message
- func (x *ListReply) Reset()
- func (x *ListReply) String() string
- type ListRequest
- type ServiceClient
- type ServiceClientProxy
- type ServiceServer
- type ServiceStatus
- func (*ServiceStatus) Descriptor() ([]byte, []int)deprecated
- func (x *ServiceStatus) GetRecentTimestampReachCurrentStatus() *timestamppb.Timestamp
- func (x *ServiceStatus) GetServiceName() string
- func (x *ServiceStatus) GetStatus() Status
- func (*ServiceStatus) ProtoMessage()
- func (x *ServiceStatus) ProtoReflect() protoreflect.Message
- func (x *ServiceStatus) Reset()
- func (x *ServiceStatus) String() string
- type Status
- type StatusManyResponse
- type StatusReply
- func (*StatusReply) Descriptor() ([]byte, []int)deprecated
- func (x *StatusReply) GetServiceStatus() *ServiceStatus
- func (x *StatusReply) GetSystemType() SystemType
- func (*StatusReply) ProtoMessage()
- func (x *StatusReply) ProtoReflect() protoreflect.Message
- func (x *StatusReply) Reset()
- func (x *StatusReply) String() string
- type StatusRequest
- func (*StatusRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StatusRequest) GetDisplayTimestamp() bool
- func (x *StatusRequest) GetServiceName() string
- func (x *StatusRequest) GetSystemType() SystemType
- func (*StatusRequest) ProtoMessage()
- func (x *StatusRequest) ProtoReflect() protoreflect.Message
- func (x *StatusRequest) Reset()
- func (x *StatusRequest) String() string
- type SystemType
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const ( Service_List_FullMethodName = "/Service.Service/List" Service_Status_FullMethodName = "/Service.Service/Status" Service_Action_FullMethodName = "/Service.Service/Action" )
Variables ¶
var ( SystemType_name = map[int32]string{ 0: "SYSTEM_TYPE_UNKNOWN", 1: "SYSTEM_TYPE_SYSTEMD", } SystemType_value = map[string]int32{ "SYSTEM_TYPE_UNKNOWN": 0, "SYSTEM_TYPE_SYSTEMD": 1, } )
Enum value maps for SystemType.
var ( Status_name = map[int32]string{ 0: "STATUS_UNKNOWN", 1: "STATUS_RUNNING", 2: "STATUS_STOPPED", } Status_value = map[string]int32{ "STATUS_UNKNOWN": 0, "STATUS_RUNNING": 1, "STATUS_STOPPED": 2, } )
Enum value maps for Status.
var ( Action_name = map[int32]string{ 0: "ACTION_UNKNOWN", 1: "ACTION_START", 2: "ACTION_STOP", 3: "ACTION_RESTART", 4: "ACTION_ENABLE", 5: "ACTION_DISABLE", 6: "ACTION_RELOAD", } Action_value = map[string]int32{ "ACTION_UNKNOWN": 0, "ACTION_START": 1, "ACTION_STOP": 2, "ACTION_RESTART": 3, "ACTION_ENABLE": 4, "ACTION_DISABLE": 5, "ACTION_RELOAD": 6, } )
Enum value maps for Action.
var File_service_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Service.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _Service_List_Handler, }, { MethodName: "Status", Handler: _Service_Status_Handler, }, { MethodName: "Action", Handler: _Service_Action_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type Action ¶
type Action int32
An action taken to modify the operational status of a service.
func (Action) Descriptor ¶
func (Action) Descriptor() protoreflect.EnumDescriptor
func (Action) EnumDescriptor
deprecated
func (Action) Number ¶
func (x Action) Number() protoreflect.EnumNumber
func (Action) Type ¶
func (Action) Type() protoreflect.EnumType
type ActionManyResponse ¶
type ActionManyResponse struct { Target string // As targets can be duplicated this is the index into the slice passed to proxy.Conn. Index int Resp *ActionReply Error error }
ActionManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.
type ActionReply ¶
type ActionReply struct { SystemType SystemType `protobuf:"varint,1,opt,name=system_type,json=systemType,proto3,enum=Service.SystemType" json:"system_type,omitempty"` ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` // contains filtered or unexported fields }
The result of a request to alter the status of a service.
func (*ActionReply) Descriptor
deprecated
func (*ActionReply) Descriptor() ([]byte, []int)
Deprecated: Use ActionReply.ProtoReflect.Descriptor instead.
func (*ActionReply) GetServiceName ¶
func (x *ActionReply) GetServiceName() string
func (*ActionReply) GetSystemType ¶
func (x *ActionReply) GetSystemType() SystemType
func (*ActionReply) ProtoMessage ¶
func (*ActionReply) ProtoMessage()
func (*ActionReply) ProtoReflect ¶
func (x *ActionReply) ProtoReflect() protoreflect.Message
func (*ActionReply) Reset ¶
func (x *ActionReply) Reset()
func (*ActionReply) String ¶
func (x *ActionReply) String() string
type ActionRequest ¶
type ActionRequest struct { SystemType SystemType `protobuf:"varint,1,opt,name=system_type,json=systemType,proto3,enum=Service.SystemType" json:"system_type,omitempty"` ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` Action Action `protobuf:"varint,3,opt,name=action,proto3,enum=Service.Action" json:"action,omitempty"` // contains filtered or unexported fields }
A request to alter the state of a single service.
func (*ActionRequest) Descriptor
deprecated
func (*ActionRequest) Descriptor() ([]byte, []int)
Deprecated: Use ActionRequest.ProtoReflect.Descriptor instead.
func (*ActionRequest) GetAction ¶
func (x *ActionRequest) GetAction() Action
func (*ActionRequest) GetServiceName ¶
func (x *ActionRequest) GetServiceName() string
func (*ActionRequest) GetSystemType ¶
func (x *ActionRequest) GetSystemType() SystemType
func (*ActionRequest) ProtoMessage ¶
func (*ActionRequest) ProtoMessage()
func (*ActionRequest) ProtoReflect ¶
func (x *ActionRequest) ProtoReflect() protoreflect.Message
func (*ActionRequest) Reset ¶
func (x *ActionRequest) Reset()
func (*ActionRequest) String ¶
func (x *ActionRequest) String() string
type ListManyResponse ¶
type ListManyResponse struct { Target string // As targets can be duplicated this is the index into the slice passed to proxy.Conn. Index int Resp *ListReply Error error }
ListManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.
type ListReply ¶
type ListReply struct { SystemType SystemType `protobuf:"varint,1,opt,name=system_type,json=systemType,proto3,enum=Service.SystemType" json:"system_type,omitempty"` Services []*ServiceStatus `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"` // contains filtered or unexported fields }
A list of all configured services, with their attendent status.
func (*ListReply) Descriptor
deprecated
func (*ListReply) GetServices ¶
func (x *ListReply) GetServices() []*ServiceStatus
func (*ListReply) GetSystemType ¶
func (x *ListReply) GetSystemType() SystemType
func (*ListReply) ProtoMessage ¶
func (*ListReply) ProtoMessage()
func (*ListReply) ProtoReflect ¶
func (x *ListReply) ProtoReflect() protoreflect.Message
type ListRequest ¶
type ListRequest struct { SystemType SystemType `protobuf:"varint,1,opt,name=system_type,json=systemType,proto3,enum=Service.SystemType" json:"system_type,omitempty"` // contains filtered or unexported fields }
A request to list all configured services for a single system type.
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetSystemType ¶
func (x *ListRequest) GetSystemType() SystemType
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ServiceClient ¶
type ServiceClient interface { // List returns a list of services with attendent status. List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error) // Status requests the status of a single service. Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) // Action alters the status of a single service. This will always force the // requested state to happen regardless of current state. Action(ctx context.Context, in *ActionRequest, opts ...grpc.CallOption) (*ActionReply, error) }
ServiceClient is the client API for Service 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.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceClientProxy ¶
type ServiceClientProxy interface { ServiceClient ListOneMany(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (<-chan *ListManyResponse, error) StatusOneMany(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (<-chan *StatusManyResponse, error) ActionOneMany(ctx context.Context, in *ActionRequest, opts ...grpc.CallOption) (<-chan *ActionManyResponse, error) }
ServiceClientProxy is the superset of ServiceClient which additionally includes the OneMany proxy methods
func NewServiceClientProxy ¶
func NewServiceClientProxy(cc *proxy.Conn) ServiceClientProxy
NewServiceClientProxy creates a ServiceClientProxy for use in proxied connections. NOTE: This takes a proxy.Conn instead of a generic ClientConnInterface as the methods here are only valid in proxy.Conn contexts.
type ServiceServer ¶
type ServiceServer interface { // List returns a list of services with attendent status. List(context.Context, *ListRequest) (*ListReply, error) // Status requests the status of a single service. Status(context.Context, *StatusRequest) (*StatusReply, error) // Action alters the status of a single service. This will always force the // requested state to happen regardless of current state. Action(context.Context, *ActionRequest) (*ActionReply, error) }
ServiceServer is the server API for Service service. All implementations should embed UnimplementedServiceServer for forward compatibility
type ServiceStatus ¶
type ServiceStatus struct { ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=Service.Status" json:"status,omitempty"` RecentTimestampReachCurrentStatus *timestamppb.Timestamp `` /* 166-byte string literal not displayed */ // contains filtered or unexported fields }
ServiceStatus pairs a service with it's current status.
func (*ServiceStatus) Descriptor
deprecated
func (*ServiceStatus) Descriptor() ([]byte, []int)
Deprecated: Use ServiceStatus.ProtoReflect.Descriptor instead.
func (*ServiceStatus) GetRecentTimestampReachCurrentStatus ¶ added in v1.28.0
func (x *ServiceStatus) GetRecentTimestampReachCurrentStatus() *timestamppb.Timestamp
func (*ServiceStatus) GetServiceName ¶
func (x *ServiceStatus) GetServiceName() string
func (*ServiceStatus) GetStatus ¶
func (x *ServiceStatus) GetStatus() Status
func (*ServiceStatus) ProtoMessage ¶
func (*ServiceStatus) ProtoMessage()
func (*ServiceStatus) ProtoReflect ¶
func (x *ServiceStatus) ProtoReflect() protoreflect.Message
func (*ServiceStatus) Reset ¶
func (x *ServiceStatus) Reset()
func (*ServiceStatus) String ¶
func (x *ServiceStatus) String() string
type Status ¶
type Status int32
The operational status of the service.
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StatusManyResponse ¶
type StatusManyResponse struct { Target string // As targets can be duplicated this is the index into the slice passed to proxy.Conn. Index int Resp *StatusReply Error error }
StatusManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.
type StatusReply ¶
type StatusReply struct { SystemType SystemType `protobuf:"varint,1,opt,name=system_type,json=systemType,proto3,enum=Service.SystemType" json:"system_type,omitempty"` ServiceStatus *ServiceStatus `protobuf:"bytes,2,opt,name=service_status,json=serviceStatus,proto3" json:"service_status,omitempty"` // contains filtered or unexported fields }
A StatusReply contains the operational status of a single service.
func (*StatusReply) Descriptor
deprecated
func (*StatusReply) Descriptor() ([]byte, []int)
Deprecated: Use StatusReply.ProtoReflect.Descriptor instead.
func (*StatusReply) GetServiceStatus ¶
func (x *StatusReply) GetServiceStatus() *ServiceStatus
func (*StatusReply) GetSystemType ¶
func (x *StatusReply) GetSystemType() SystemType
func (*StatusReply) ProtoMessage ¶
func (*StatusReply) ProtoMessage()
func (*StatusReply) ProtoReflect ¶
func (x *StatusReply) ProtoReflect() protoreflect.Message
func (*StatusReply) Reset ¶
func (x *StatusReply) Reset()
func (*StatusReply) String ¶
func (x *StatusReply) String() string
type StatusRequest ¶
type StatusRequest struct { SystemType SystemType `protobuf:"varint,1,opt,name=system_type,json=systemType,proto3,enum=Service.SystemType" json:"system_type,omitempty"` ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` DisplayTimestamp bool `protobuf:"varint,3,opt,name=display_timestamp,json=displayTimestamp,proto3" json:"display_timestamp,omitempty"` // contains filtered or unexported fields }
A request to list the status of a single service.
func (*StatusRequest) Descriptor
deprecated
func (*StatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) GetDisplayTimestamp ¶ added in v1.28.0
func (x *StatusRequest) GetDisplayTimestamp() bool
func (*StatusRequest) GetServiceName ¶
func (x *StatusRequest) GetServiceName() string
func (*StatusRequest) GetSystemType ¶
func (x *StatusRequest) GetSystemType() SystemType
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) ProtoReflect ¶
func (x *StatusRequest) ProtoReflect() protoreflect.Message
func (*StatusRequest) Reset ¶
func (x *StatusRequest) Reset()
func (*StatusRequest) String ¶
func (x *StatusRequest) String() string
type SystemType ¶
type SystemType int32
A SystemType specifies the service management system on which to operate. The 'unknown' value, if specified in a request, will map to an appropriate implementation-defined default for the system running SansShell.
const ( SystemType_SYSTEM_TYPE_UNKNOWN SystemType = 0 SystemType_SYSTEM_TYPE_SYSTEMD SystemType = 1 )
func (SystemType) Descriptor ¶
func (SystemType) Descriptor() protoreflect.EnumDescriptor
func (SystemType) Enum ¶
func (x SystemType) Enum() *SystemType
func (SystemType) EnumDescriptor
deprecated
func (SystemType) EnumDescriptor() ([]byte, []int)
Deprecated: Use SystemType.Descriptor instead.
func (SystemType) Number ¶
func (x SystemType) Number() protoreflect.EnumNumber
func (SystemType) String ¶
func (x SystemType) String() string
func (SystemType) Type ¶
func (SystemType) Type() protoreflect.EnumType
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) Action ¶
func (UnimplementedServiceServer) Action(context.Context, *ActionRequest) (*ActionReply, error)
func (UnimplementedServiceServer) List ¶
func (UnimplementedServiceServer) List(context.Context, *ListRequest) (*ListReply, error)
func (UnimplementedServiceServer) Status ¶
func (UnimplementedServiceServer) Status(context.Context, *StatusRequest) (*StatusReply, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.