serviceV1

package
v6.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var File_service_v1_service_proto protoreflect.FileDescriptor
View Source
var File_service_v1_service_rpc_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Create.ProtoReflect.Descriptor instead.

func (*Create) GetCommand

func (x *Create) GetCommand() string

func (*Create) GetEnv

func (x *Create) GetEnv() map[string]string

func (*Create) GetExecTimeout

func (x *Create) GetExecTimeout() int64

func (*Create) GetName

func (x *Create) GetName() string

func (*Create) GetProcessNum

func (x *Create) GetProcessNum() int64

func (*Create) GetRemainAfterExit

func (x *Create) GetRemainAfterExit() bool

func (*Create) GetRestartSec

func (x *Create) GetRestartSec() uint64

func (*Create) GetServiceNameInLogs

func (x *Create) GetServiceNameInLogs() bool

func (*Create) GetTimeoutStopSec

func (x *Create) GetTimeoutStopSec() uint64

func (*Create) ProtoMessage

func (*Create) ProtoMessage()

func (*Create) ProtoReflect

func (x *Create) ProtoReflect() protoreflect.Message

func (*Create) Reset

func (x *Create) Reset()

func (*Create) String

func (x *Create) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use List.ProtoReflect.Descriptor instead.

func (*List) GetServices

func (x *List) GetServices() []string

func (*List) ProtoMessage

func (*List) ProtoMessage()

func (*List) ProtoReflect

func (x *List) ProtoReflect() protoreflect.Message

func (*List) Reset

func (x *List) Reset()

func (*List) String

func (x *List) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetMessage

func (x *Response) GetMessage() string

func (*Response) GetOk

func (x *Response) GetOk() bool

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetName

func (x *Service) GetName() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

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, …).

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) Descriptor() ([]byte, []int)

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetCommand

func (x *Status) GetCommand() string

func (*Status) GetCpuPercent

func (x *Status) GetCpuPercent() float32

func (*Status) GetMemoryUsage

func (x *Status) GetMemoryUsage() uint64

func (*Status) GetPid

func (x *Status) GetPid() int32

func (*Status) GetStatus

func (x *Status) GetStatus() *v1.Status

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

func (x *Status) ProtoReflect() protoreflect.Message

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Statuses.ProtoReflect.Descriptor instead.

func (*Statuses) GetStatus

func (x *Statuses) GetStatus() []*Status

func (*Statuses) ProtoMessage

func (*Statuses) ProtoMessage()

func (*Statuses) ProtoReflect

func (x *Statuses) ProtoReflect() protoreflect.Message

func (*Statuses) Reset

func (x *Statuses) Reset()

func (*Statuses) String

func (x *Statuses) String() string

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) GetStatus

func (UnimplementedServiceManagerServer) GetStatuses

func (UnimplementedServiceManagerServer) ListServices

func (UnimplementedServiceManagerServer) Restart

func (UnimplementedServiceManagerServer) Terminate

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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