sysinfo

package
v1.23.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package sysinfo defines the RPC interface for the sansshell SysInfo actions.

Index

Constants

View Source
const (
	SysInfo_Uptime_FullMethodName = "/SysInfo.SysInfo/Uptime"
	SysInfo_Dmesg_FullMethodName  = "/SysInfo.SysInfo/Dmesg"
)

Variables

View Source
var File_sysinfo_proto protoreflect.FileDescriptor
View Source
var SysInfo_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "SysInfo.SysInfo",
	HandlerType: (*SysInfoServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Uptime",
			Handler:    _SysInfo_Uptime_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Dmesg",
			Handler:       _SysInfo_Dmesg_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "sysinfo.proto",
}

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

Functions

func RegisterSysInfoServer

func RegisterSysInfoServer(s grpc.ServiceRegistrar, srv SysInfoServer)

Types

type DmesgManyResponse added in v1.23.0

type DmesgManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *DmesgReply
	Error error
}

DmesgManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type DmesgReply added in v1.23.0

type DmesgReply struct {
	Record *DmsgRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
	// contains filtered or unexported fields
}

DmesgReply contains the messages from kernel

func (*DmesgReply) Descriptor deprecated added in v1.23.0

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

Deprecated: Use DmesgReply.ProtoReflect.Descriptor instead.

func (*DmesgReply) GetRecord added in v1.23.0

func (x *DmesgReply) GetRecord() *DmsgRecord

func (*DmesgReply) ProtoMessage added in v1.23.0

func (*DmesgReply) ProtoMessage()

func (*DmesgReply) ProtoReflect added in v1.23.0

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

func (*DmesgReply) Reset added in v1.23.0

func (x *DmesgReply) Reset()

func (*DmesgReply) String added in v1.23.0

func (x *DmesgReply) String() string

type DmesgRequest added in v1.23.0

type DmesgRequest struct {

	// tail the number of line from the dmesg output, negative means display all messages
	TailLines   int32  `protobuf:"varint,1,opt,name=tail_lines,json=tailLines,proto3" json:"tail_lines,omitempty"`
	Grep        string `protobuf:"bytes,2,opt,name=grep,proto3" json:"grep,omitempty"`
	IgnoreCase  bool   `protobuf:"varint,3,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"`
	InvertMatch bool   `protobuf:"varint,4,opt,name=invert_match,json=invertMatch,proto3" json:"invert_match,omitempty"`
	// contains filtered or unexported fields
}

DmesgRequest describes the filename to be tailed.

func (*DmesgRequest) Descriptor deprecated added in v1.23.0

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

Deprecated: Use DmesgRequest.ProtoReflect.Descriptor instead.

func (*DmesgRequest) GetGrep added in v1.23.0

func (x *DmesgRequest) GetGrep() string

func (*DmesgRequest) GetIgnoreCase added in v1.23.0

func (x *DmesgRequest) GetIgnoreCase() bool

func (*DmesgRequest) GetInvertMatch added in v1.23.0

func (x *DmesgRequest) GetInvertMatch() bool

func (*DmesgRequest) GetTailLines added in v1.23.0

func (x *DmesgRequest) GetTailLines() int32

func (*DmesgRequest) ProtoMessage added in v1.23.0

func (*DmesgRequest) ProtoMessage()

func (*DmesgRequest) ProtoReflect added in v1.23.0

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

func (*DmesgRequest) Reset added in v1.23.0

func (x *DmesgRequest) Reset()

func (*DmesgRequest) String added in v1.23.0

func (x *DmesgRequest) String() string

type DmsgRecord added in v1.23.0

type DmsgRecord struct {
	Time    *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	Message string                 `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

DmesgRecord contains the specific fields about the a dmesg record

func (*DmsgRecord) Descriptor deprecated added in v1.23.0

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

Deprecated: Use DmsgRecord.ProtoReflect.Descriptor instead.

func (*DmsgRecord) GetMessage added in v1.23.0

func (x *DmsgRecord) GetMessage() string

func (*DmsgRecord) GetTime added in v1.23.0

func (x *DmsgRecord) GetTime() *timestamppb.Timestamp

func (*DmsgRecord) ProtoMessage added in v1.23.0

func (*DmsgRecord) ProtoMessage()

func (*DmsgRecord) ProtoReflect added in v1.23.0

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

func (*DmsgRecord) Reset added in v1.23.0

func (x *DmsgRecord) Reset()

func (*DmsgRecord) String added in v1.23.0

func (x *DmsgRecord) String() string

type SysInfoClient

type SysInfoClient interface {
	// Uptime return
	Uptime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UptimeReply, error)
	// display kernel-related messages
	Dmesg(ctx context.Context, in *DmesgRequest, opts ...grpc.CallOption) (SysInfo_DmesgClient, error)
}

SysInfoClient is the client API for SysInfo 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 NewSysInfoClient

func NewSysInfoClient(cc grpc.ClientConnInterface) SysInfoClient

type SysInfoClientProxy

type SysInfoClientProxy interface {
	SysInfoClient
	UptimeOneMany(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (<-chan *UptimeManyResponse, error)
	DmesgOneMany(ctx context.Context, in *DmesgRequest, opts ...grpc.CallOption) (SysInfo_DmesgClientProxy, error)
}

SysInfoClientProxy is the superset of SysInfoClient which additionally includes the OneMany proxy methods

func NewSysInfoClientProxy

func NewSysInfoClientProxy(cc *proxy.Conn) SysInfoClientProxy

NewSysInfoClientProxy creates a SysInfoClientProxy 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 SysInfoServer

type SysInfoServer interface {
	// Uptime return
	Uptime(context.Context, *emptypb.Empty) (*UptimeReply, error)
	// display kernel-related messages
	Dmesg(*DmesgRequest, SysInfo_DmesgServer) error
}

SysInfoServer is the server API for SysInfo service. All implementations should embed UnimplementedSysInfoServer for forward compatibility

type SysInfo_DmesgClient added in v1.23.0

type SysInfo_DmesgClient interface {
	Recv() (*DmesgReply, error)
	grpc.ClientStream
}

type SysInfo_DmesgClientProxy added in v1.23.0

type SysInfo_DmesgClientProxy interface {
	Recv() ([]*DmesgManyResponse, error)
	grpc.ClientStream
}

type SysInfo_DmesgServer added in v1.23.0

type SysInfo_DmesgServer interface {
	Send(*DmesgReply) error
	grpc.ServerStream
}

type UnimplementedSysInfoServer

type UnimplementedSysInfoServer struct {
}

UnimplementedSysInfoServer should be embedded to have forward compatible implementations.

func (UnimplementedSysInfoServer) Dmesg added in v1.23.0

func (UnimplementedSysInfoServer) Uptime

type UnsafeSysInfoServer

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

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

type UptimeManyResponse

type UptimeManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *UptimeReply
	Error error
}

UptimeManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type UptimeReply

type UptimeReply struct {

	// show the uptime in protobuf.Duration
	UptimeSeconds *durationpb.Duration `protobuf:"bytes,1,opt,name=uptime_seconds,json=uptimeSeconds,proto3" json:"uptime_seconds,omitempty"`
	// contains filtered or unexported fields
}

func (*UptimeReply) Descriptor deprecated

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

Deprecated: Use UptimeReply.ProtoReflect.Descriptor instead.

func (*UptimeReply) GetUptimeSeconds

func (x *UptimeReply) GetUptimeSeconds() *durationpb.Duration

func (*UptimeReply) ProtoMessage

func (*UptimeReply) ProtoMessage()

func (*UptimeReply) ProtoReflect

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

func (*UptimeReply) Reset

func (x *UptimeReply) Reset()

func (*UptimeReply) String

func (x *UptimeReply) String() string

Directories

Path Synopsis
Package client provides the client interface for 'sysinfo'
Package client provides the client interface for 'sysinfo'
Package server implements the sansshell 'SysInfo' service.
Package server implements the sansshell 'SysInfo' service.

Jump to

Keyboard shortcuts

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