dispatcher

package
v0.0.0-...-c01e340 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dispatcher_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Dispatcher",
	HandlerType: (*DispatcherServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Start",
			Handler:    _Dispatcher_Start_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _Dispatcher_Stop_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _Dispatcher_Status_Handler,
		},
		{
			MethodName: "Reload",
			Handler:    _Dispatcher_Reload_Handler,
		},
		{
			MethodName: "ReadConfigs",
			Handler:    _Dispatcher_ReadConfigs_Handler,
		},
		{
			MethodName: "Version",
			Handler:    _Dispatcher_Version_Handler,
		},
		{
			MethodName: "Shutdown",
			Handler:    _Dispatcher_Shutdown_Handler,
		},
		{
			MethodName: "Reboot",
			Handler:    _Dispatcher_Reboot_Handler,
		},
		{
			MethodName: "Halt",
			Handler:    _Dispatcher_Halt_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SystemStatus",
			Handler:       _Dispatcher_SystemStatus_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SystemLogs",
			Handler:       _Dispatcher_SystemLogs_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "dispatcher.proto",
}

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

View Source
var File_dispatcher_proto protoreflect.FileDescriptor

Functions

func RegisterDispatcherServer

func RegisterDispatcherServer(s grpc.ServiceRegistrar, srv DispatcherServer)

Types

type DispatcherClient

type DispatcherClient interface {
	// Service related bits
	Start(ctx context.Context, in *Service, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Stop(ctx context.Context, in *Service, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Status(ctx context.Context, in *Service, opts ...grpc.CallOption) (*ServiceStatus, error)
	Reload(ctx context.Context, in *Service, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// vinit related operations
	ReadConfigs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	SystemStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Dispatcher_SystemStatusClient, error)
	Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionMessage, error)
	SystemLogs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Dispatcher_SystemLogsClient, error)
	// shutdown (etc.) commands
	Shutdown(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Reboot(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Halt(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

DispatcherClient is the client API for Dispatcher 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 NewDispatcherClient

func NewDispatcherClient(cc grpc.ClientConnInterface) DispatcherClient

type DispatcherServer

type DispatcherServer interface {
	// Service related bits
	Start(context.Context, *Service) (*emptypb.Empty, error)
	Stop(context.Context, *Service) (*emptypb.Empty, error)
	Status(context.Context, *Service) (*ServiceStatus, error)
	Reload(context.Context, *Service) (*emptypb.Empty, error)
	// vinit related operations
	ReadConfigs(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	SystemStatus(*emptypb.Empty, Dispatcher_SystemStatusServer) error
	Version(context.Context, *emptypb.Empty) (*VersionMessage, error)
	SystemLogs(*emptypb.Empty, Dispatcher_SystemLogsServer) error
	// shutdown (etc.) commands
	Shutdown(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	Reboot(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	Halt(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

DispatcherServer is the server API for Dispatcher service. All implementations must embed UnimplementedDispatcherServer for forward compatibility

type Dispatcher_SystemLogsClient

type Dispatcher_SystemLogsClient interface {
	Recv() (*LogMessage, error)
	grpc.ClientStream
}

type Dispatcher_SystemLogsServer

type Dispatcher_SystemLogsServer interface {
	Send(*LogMessage) error
	grpc.ServerStream
}

type Dispatcher_SystemStatusClient

type Dispatcher_SystemStatusClient interface {
	Recv() (*ServiceStatus, error)
	grpc.ClientStream
}

type Dispatcher_SystemStatusServer

type Dispatcher_SystemStatusServer interface {
	Send(*ServiceStatus) error
	grpc.ServerStream
}

type LogMessage

type LogMessage struct {
	Line string `protobuf:"bytes,1,opt,name=line,proto3" json:"line,omitempty"`
	// contains filtered or unexported fields
}

func (*LogMessage) Descriptor deprecated

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

Deprecated: Use LogMessage.ProtoReflect.Descriptor instead.

func (*LogMessage) GetLine

func (x *LogMessage) GetLine() string

func (*LogMessage) ProtoMessage

func (*LogMessage) ProtoMessage()

func (*LogMessage) ProtoReflect

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

func (*LogMessage) Reset

func (x *LogMessage) Reset()

func (*LogMessage) String

func (x *LogMessage) 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 ServiceStatus

type ServiceStatus struct {
	Svc        *Service               `protobuf:"bytes,1,opt,name=svc,proto3" json:"svc,omitempty"`
	Running    bool                   `protobuf:"varint,2,opt,name=running,proto3" json:"running,omitempty"`
	Pid        uint32                 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
	ExitStatus uint32                 `protobuf:"varint,4,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
	StartTime  *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime    *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	Success    bool                   `protobuf:"varint,7,opt,name=success,proto3" json:"success,omitempty"`
	Error      string                 `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceStatus) Descriptor deprecated

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

Deprecated: Use ServiceStatus.ProtoReflect.Descriptor instead.

func (*ServiceStatus) GetEndTime

func (x *ServiceStatus) GetEndTime() *timestamppb.Timestamp

func (*ServiceStatus) GetError

func (x *ServiceStatus) GetError() string

func (*ServiceStatus) GetExitStatus

func (x *ServiceStatus) GetExitStatus() uint32

func (*ServiceStatus) GetPid

func (x *ServiceStatus) GetPid() uint32

func (*ServiceStatus) GetRunning

func (x *ServiceStatus) GetRunning() bool

func (*ServiceStatus) GetStartTime

func (x *ServiceStatus) GetStartTime() *timestamppb.Timestamp

func (*ServiceStatus) GetSuccess

func (x *ServiceStatus) GetSuccess() bool

func (*ServiceStatus) GetSvc

func (x *ServiceStatus) GetSvc() *Service

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 UnimplementedDispatcherServer

type UnimplementedDispatcherServer struct {
}

UnimplementedDispatcherServer must be embedded to have forward compatible implementations.

func (UnimplementedDispatcherServer) Halt

func (UnimplementedDispatcherServer) ReadConfigs

func (UnimplementedDispatcherServer) Reboot

func (UnimplementedDispatcherServer) Reload

func (UnimplementedDispatcherServer) Shutdown

func (UnimplementedDispatcherServer) Start

func (UnimplementedDispatcherServer) Status

func (UnimplementedDispatcherServer) Stop

func (UnimplementedDispatcherServer) SystemLogs

func (UnimplementedDispatcherServer) SystemStatus

func (UnimplementedDispatcherServer) Version

type UnsafeDispatcherServer

type UnsafeDispatcherServer interface {
	// contains filtered or unexported methods
}

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

type VersionMessage

type VersionMessage struct {
	Ref       string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
	BuildUser string `protobuf:"bytes,2,opt,name=build_user,json=buildUser,proto3" json:"build_user,omitempty"`
	// We store this as a string, rather than a datetime, because
	// we never need to do anything clever with it, beyond showing it
	BuiltOn string `protobuf:"bytes,3,opt,name=built_on,json=builtOn,proto3" json:"built_on,omitempty"`
	// contains filtered or unexported fields
}

func (*VersionMessage) Descriptor deprecated

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

Deprecated: Use VersionMessage.ProtoReflect.Descriptor instead.

func (*VersionMessage) GetBuildUser

func (x *VersionMessage) GetBuildUser() string

func (*VersionMessage) GetBuiltOn

func (x *VersionMessage) GetBuiltOn() string

func (*VersionMessage) GetRef

func (x *VersionMessage) GetRef() string

func (*VersionMessage) ProtoMessage

func (*VersionMessage) ProtoMessage()

func (*VersionMessage) ProtoReflect

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

func (*VersionMessage) Reset

func (x *VersionMessage) Reset()

func (*VersionMessage) String

func (x *VersionMessage) String() string

Jump to

Keyboard shortcuts

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