Skip to content

Systemd Go-API

import "givc/modules/api/systemd"

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

const (
UnitControlService_StartApplication_FullMethodName = "/systemd.UnitControlService/StartApplication"
UnitControlService_StartUnit_FullMethodName = "/systemd.UnitControlService/StartUnit"
UnitControlService_StopUnit_FullMethodName = "/systemd.UnitControlService/StopUnit"
UnitControlService_KillUnit_FullMethodName = "/systemd.UnitControlService/KillUnit"
UnitControlService_FreezeUnit_FullMethodName = "/systemd.UnitControlService/FreezeUnit"
UnitControlService_UnfreezeUnit_FullMethodName = "/systemd.UnitControlService/UnfreezeUnit"
UnitControlService_GetUnitStatus_FullMethodName = "/systemd.UnitControlService/GetUnitStatus"
UnitControlService_MonitorUnit_FullMethodName = "/systemd.UnitControlService/MonitorUnit"
)

This is a compile-time assertion to ensure that this generated file is compatible with the grpc package it is being compiled against. Requires gRPC-Go v1.64.0 or later.

const _ = grpc.SupportPackageIsVersion9

const file_systemd_systemd_proto_rawDesc = "" +
"\n" +
"\x15systemd/systemd.proto\x12\asystemd\"\xd6\x01\n" +
"\n" +
"UnitStatus\x12\x12\n" +
"\x04Name\x18\x01 \x01(\tR\x04Name\x12 \n" +
"\vDescription\x18\x02 \x01(\tR\vDescription\x12\x1c\n" +
"\tLoadState\x18\x03 \x01(\tR\tLoadState\x12 \n" +
"\vActiveState\x18\x04 \x01(\tR\vActiveState\x12\x1a\n" +
"\bSubState\x18\x05 \x01(\tR\bSubState\x12\x12\n" +
"\x04Path\x18\x06 \x01(\tR\x04Path\x12\"\n" +
"\fFreezerState\x18\a \x01(\tR\fFreezerState\")\n" +
"\vUnitRequest\x12\x1a\n" +
"\bUnitName\x18\x01 \x01(\tR\bUnitName\"@\n" +
"\x0eAppUnitRequest\x12\x1a\n" +
"\bUnitName\x18\x01 \x01(\tR\bUnitName\x12\x12\n" +
"\x04Args\x18\x02 \x03(\tR\x04Args\"C\n" +
"\fUnitResponse\x123\n" +
"\n" +
"UnitStatus\x18\x01 \x01(\v2\x13.systemd.UnitStatusR\n" +
"UnitStatus\"1\n" +
"\x13UnitResourceRequest\x12\x1a\n" +
"\bUnitName\x18\x01 \x01(\tR\bUnitName\"V\n" +
"\x14UnitResourceResponse\x12\x1b\n" +
"\tcpu_usage\x18\x01 \x01(\x01R\bcpuUsage\x12!\n" +
"\fmemory_usage\x18\x02 \x01(\x02R\vmemoryUsage2\x98\x04\n" +
"\x12UnitControlService\x12D\n" +
"\x10StartApplication\x12\x17.systemd.AppUnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x12:\n" +
"\tStartUnit\x12\x14.systemd.UnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x129\n" +
"\bStopUnit\x12\x14.systemd.UnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x129\n" +
"\bKillUnit\x12\x14.systemd.UnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x12;\n" +
"\n" +
"FreezeUnit\x12\x14.systemd.UnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x12=\n" +
"\fUnfreezeUnit\x12\x14.systemd.UnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x12>\n" +
"\rGetUnitStatus\x12\x14.systemd.UnitRequest\x1a\x15.systemd.UnitResponse\"\x00\x12N\n" +
"\vMonitorUnit\x12\x1c.systemd.UnitResourceRequest\x1a\x1d.systemd.UnitResourceResponse\"\x000\x01B\x1aZ\x18givc/modules/api/systemdb\x06proto3"

var (
file_systemd_systemd_proto_rawDescOnce sync.Once
file_systemd_systemd_proto_rawDescData []byte
)

var File_systemd_systemd_proto protoreflect.FileDescriptor

UnitControlService_ServiceDesc is the grpc.ServiceDesc for UnitControlService service. It’s only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

var UnitControlService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "systemd.UnitControlService",
HandlerType: (*UnitControlServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "StartApplication",
Handler: _UnitControlService_StartApplication_Handler,
},
{
MethodName: "StartUnit",
Handler: _UnitControlService_StartUnit_Handler,
},
{
MethodName: "StopUnit",
Handler: _UnitControlService_StopUnit_Handler,
},
{
MethodName: "KillUnit",
Handler: _UnitControlService_KillUnit_Handler,
},
{
MethodName: "FreezeUnit",
Handler: _UnitControlService_FreezeUnit_Handler,
},
{
MethodName: "UnfreezeUnit",
Handler: _UnitControlService_UnfreezeUnit_Handler,
},
{
MethodName: "GetUnitStatus",
Handler: _UnitControlService_GetUnitStatus_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "MonitorUnit",
Handler: _UnitControlService_MonitorUnit_Handler,
ServerStreams: true,
},
},
Metadata: "systemd/systemd.proto",
}

var file_systemd_systemd_proto_depIdxs = []int32{
0,
2,
1,
1,
1,
1,
1,
1,
4,
3,
3,
3,
3,
3,
3,
3,
5,
9,
1,
1,
1,
0,
}

var file_systemd_systemd_proto_goTypes = []any{
(*UnitStatus)(nil),
(*UnitRequest)(nil),
(*AppUnitRequest)(nil),
(*UnitResponse)(nil),
(*UnitResourceRequest)(nil),
(*UnitResourceResponse)(nil),
}

var file_systemd_systemd_proto_msgTypes = make([]protoimpl.MessageInfo, 6)

func RegisterUnitControlServiceServer(s grpc.ServiceRegistrar, srv UnitControlServiceServer)

func _UnitControlService_FreezeUnit_Handler

Section titled “func _UnitControlService_FreezeUnit_Handler”
func _UnitControlService_FreezeUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _UnitControlService_GetUnitStatus_Handler

Section titled “func _UnitControlService_GetUnitStatus_Handler”
func _UnitControlService_GetUnitStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _UnitControlService_KillUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _UnitControlService_MonitorUnit_Handler

Section titled “func _UnitControlService_MonitorUnit_Handler”
func _UnitControlService_MonitorUnit_Handler(srv interface{}, stream grpc.ServerStream) error

func _UnitControlService_StartApplication_Handler

Section titled “func _UnitControlService_StartApplication_Handler”
func _UnitControlService_StartApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _UnitControlService_StartUnit_Handler

Section titled “func _UnitControlService_StartUnit_Handler”
func _UnitControlService_StartUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _UnitControlService_StopUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func _UnitControlService_UnfreezeUnit_Handler

Section titled “func _UnitControlService_UnfreezeUnit_Handler”
func _UnitControlService_UnfreezeUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error)

func file_systemd_systemd_proto_init()

func file_systemd_systemd_proto_rawDescGZIP

Section titled “func file_systemd_systemd_proto_rawDescGZIP”
func file_systemd_systemd_proto_rawDescGZIP() []byte

func init()

type AppUnitRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UnitName string `protobuf:"bytes,1,opt,name=UnitName,proto3" json:"UnitName,omitempty"`
Args []string `protobuf:"bytes,2,rep,name=Args,proto3" json:"Args,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

func (*AppUnitRequest) Descriptor() ([]byte, []int)

Deprecated: Use AppUnitRequest.ProtoReflect.Descriptor instead.

func (x *AppUnitRequest) GetArgs() []string

func (x *AppUnitRequest) GetUnitName() string

func (*AppUnitRequest) ProtoMessage()

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

func (x *AppUnitRequest) Reset()

func (x *AppUnitRequest) String() string

type UnimplementedUnitControlServiceServer

Section titled “type UnimplementedUnitControlServiceServer”

UnimplementedUnitControlServiceServer 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.

type UnimplementedUnitControlServiceServer struct{}

func (UnimplementedUnitControlServiceServer) FreezeUnit

Section titled “func (UnimplementedUnitControlServiceServer) FreezeUnit”
func (UnimplementedUnitControlServiceServer) FreezeUnit(context.Context, *UnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) GetUnitStatus

Section titled “func (UnimplementedUnitControlServiceServer) GetUnitStatus”
func (UnimplementedUnitControlServiceServer) GetUnitStatus(context.Context, *UnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) KillUnit

Section titled “func (UnimplementedUnitControlServiceServer) KillUnit”
func (UnimplementedUnitControlServiceServer) KillUnit(context.Context, *UnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) MonitorUnit

Section titled “func (UnimplementedUnitControlServiceServer) MonitorUnit”
func (UnimplementedUnitControlServiceServer) MonitorUnit(*UnitResourceRequest, grpc.ServerStreamingServer[UnitResourceResponse]) error

func (UnimplementedUnitControlServiceServer) StartApplication

Section titled “func (UnimplementedUnitControlServiceServer) StartApplication”
func (UnimplementedUnitControlServiceServer) StartApplication(context.Context, *AppUnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) StartUnit

Section titled “func (UnimplementedUnitControlServiceServer) StartUnit”
func (UnimplementedUnitControlServiceServer) StartUnit(context.Context, *UnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) StopUnit

Section titled “func (UnimplementedUnitControlServiceServer) StopUnit”
func (UnimplementedUnitControlServiceServer) StopUnit(context.Context, *UnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) UnfreezeUnit

Section titled “func (UnimplementedUnitControlServiceServer) UnfreezeUnit”
func (UnimplementedUnitControlServiceServer) UnfreezeUnit(context.Context, *UnitRequest) (*UnitResponse, error)

func (UnimplementedUnitControlServiceServer) mustEmbedUnimplementedUnitControlServiceServer

Section titled “func (UnimplementedUnitControlServiceServer) mustEmbedUnimplementedUnitControlServiceServer”
func (UnimplementedUnitControlServiceServer) mustEmbedUnimplementedUnitControlServiceServer()

func (UnimplementedUnitControlServiceServer) testEmbeddedByValue

Section titled “func (UnimplementedUnitControlServiceServer) testEmbeddedByValue”
func (UnimplementedUnitControlServiceServer) testEmbeddedByValue()

UnitControlServiceClient is the client API for UnitControlService 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.

type UnitControlServiceClient interface {
StartApplication(ctx context.Context, in *AppUnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
StartUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
StopUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
KillUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
FreezeUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
UnfreezeUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
GetUnitStatus(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)
MonitorUnit(ctx context.Context, in *UnitResourceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[UnitResourceResponse], error)
}

func NewUnitControlServiceClient(cc grpc.ClientConnInterface) UnitControlServiceClient

UnitControlServiceServer is the server API for UnitControlService service. All implementations must embed UnimplementedUnitControlServiceServer for forward compatibility.

type UnitControlServiceServer interface {
StartApplication(context.Context, *AppUnitRequest) (*UnitResponse, error)
StartUnit(context.Context, *UnitRequest) (*UnitResponse, error)
StopUnit(context.Context, *UnitRequest) (*UnitResponse, error)
KillUnit(context.Context, *UnitRequest) (*UnitResponse, error)
FreezeUnit(context.Context, *UnitRequest) (*UnitResponse, error)
UnfreezeUnit(context.Context, *UnitRequest) (*UnitResponse, error)
GetUnitStatus(context.Context, *UnitRequest) (*UnitResponse, error)
MonitorUnit(*UnitResourceRequest, grpc.ServerStreamingServer[UnitResourceResponse]) error
mustEmbedUnimplementedUnitControlServiceServer()
}

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnitControlService_MonitorUnitClient = grpc.ServerStreamingClient[UnitResourceResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnitControlService_MonitorUnitServer = grpc.ServerStreamingServer[UnitResourceResponse]

type UnitRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UnitName string `protobuf:"bytes,1,opt,name=UnitName,proto3" json:"UnitName,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

func (*UnitRequest) Descriptor() ([]byte, []int)

Deprecated: Use UnitRequest.ProtoReflect.Descriptor instead.

func (x *UnitRequest) GetUnitName() string

func (*UnitRequest) ProtoMessage()

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

func (x *UnitRequest) Reset()

func (x *UnitRequest) String() string

type UnitResourceRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UnitName string `protobuf:"bytes,1,opt,name=UnitName,proto3" json:"UnitName,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

func (*UnitResourceRequest) Descriptor() ([]byte, []int)

Deprecated: Use UnitResourceRequest.ProtoReflect.Descriptor instead.

func (x *UnitResourceRequest) GetUnitName() string

func (*UnitResourceRequest) ProtoMessage()

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

func (x *UnitResourceRequest) Reset()

func (x *UnitResourceRequest) String() string

type UnitResourceResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
CpuUsage float64 `protobuf:"fixed64,1,opt,name=cpu_usage,json=cpuUsage,proto3" json:"cpu_usage,omitempty"`
MemoryUsage float32 `protobuf:"fixed32,2,opt,name=memory_usage,json=memoryUsage,proto3" json:"memory_usage,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

func (*UnitResourceResponse) Descriptor() ([]byte, []int)

Deprecated: Use UnitResourceResponse.ProtoReflect.Descriptor instead.

func (x *UnitResourceResponse) GetCpuUsage() float64

func (*UnitResourceResponse) GetMemoryUsage

Section titled “func (*UnitResourceResponse) GetMemoryUsage”
func (x *UnitResourceResponse) GetMemoryUsage() float32

func (*UnitResourceResponse) ProtoMessage()

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

func (x *UnitResourceResponse) Reset()

func (x *UnitResourceResponse) String() string

type UnitResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
UnitStatus *UnitStatus `protobuf:"bytes,1,opt,name=UnitStatus,proto3" json:"UnitStatus,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

func (*UnitResponse) Descriptor() ([]byte, []int)

Deprecated: Use UnitResponse.ProtoReflect.Descriptor instead.

func (x *UnitResponse) GetUnitStatus() *UnitStatus

func (*UnitResponse) ProtoMessage()

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

func (x *UnitResponse) Reset()

func (x *UnitResponse) String() string

type UnitStatus struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=Description,proto3" json:"Description,omitempty"`
LoadState string `protobuf:"bytes,3,opt,name=LoadState,proto3" json:"LoadState,omitempty"`
ActiveState string `protobuf:"bytes,4,opt,name=ActiveState,proto3" json:"ActiveState,omitempty"`
SubState string `protobuf:"bytes,5,opt,name=SubState,proto3" json:"SubState,omitempty"`
Path string `protobuf:"bytes,6,opt,name=Path,proto3" json:"Path,omitempty"`
FreezerState string `protobuf:"bytes,7,opt,name=FreezerState,proto3" json:"FreezerState,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}

func (*UnitStatus) Descriptor() ([]byte, []int)

Deprecated: Use UnitStatus.ProtoReflect.Descriptor instead.

func (x *UnitStatus) GetActiveState() string

func (x *UnitStatus) GetDescription() string

func (x *UnitStatus) GetFreezerState() string

func (x *UnitStatus) GetLoadState() string

func (x *UnitStatus) GetName() string

func (x *UnitStatus) GetPath() string

func (x *UnitStatus) GetSubState() string

func (*UnitStatus) ProtoMessage()

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

func (x *UnitStatus) Reset()

func (x *UnitStatus) String() string

UnsafeUnitControlServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UnitControlServiceServer will result in compilation errors.

type UnsafeUnitControlServiceServer interface {
mustEmbedUnimplementedUnitControlServiceServer()
}

type unitControlServiceClient struct {
cc grpc.ClientConnInterface
}

func (*unitControlServiceClient) FreezeUnit

Section titled “func (*unitControlServiceClient) FreezeUnit”
func (c *unitControlServiceClient) FreezeUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

func (*unitControlServiceClient) GetUnitStatus

Section titled “func (*unitControlServiceClient) GetUnitStatus”
func (c *unitControlServiceClient) GetUnitStatus(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

func (c *unitControlServiceClient) KillUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

func (*unitControlServiceClient) MonitorUnit

Section titled “func (*unitControlServiceClient) MonitorUnit”
func (c *unitControlServiceClient) MonitorUnit(ctx context.Context, in *UnitResourceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[UnitResourceResponse], error)

func (*unitControlServiceClient) StartApplication

Section titled “func (*unitControlServiceClient) StartApplication”
func (c *unitControlServiceClient) StartApplication(ctx context.Context, in *AppUnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

func (*unitControlServiceClient) StartUnit

Section titled “func (*unitControlServiceClient) StartUnit”
func (c *unitControlServiceClient) StartUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

func (c *unitControlServiceClient) StopUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

func (*unitControlServiceClient) UnfreezeUnit

Section titled “func (*unitControlServiceClient) UnfreezeUnit”
func (c *unitControlServiceClient) UnfreezeUnit(ctx context.Context, in *UnitRequest, opts ...grpc.CallOption) (*UnitResponse, error)

Generated by gomarkdoc