proto

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NezhaService_ReportSystemState_FullMethodName = "/proto.NezhaService/ReportSystemState"
	NezhaService_ReportSystemInfo_FullMethodName  = "/proto.NezhaService/ReportSystemInfo"
	NezhaService_ReportTask_FullMethodName        = "/proto.NezhaService/ReportTask"
	NezhaService_RequestTask_FullMethodName       = "/proto.NezhaService/RequestTask"
)

Variables

View Source
var File_proto_nezha_proto protoreflect.FileDescriptor
View Source
var NezhaService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.NezhaService",
	HandlerType: (*NezhaServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ReportSystemState",
			Handler:    _NezhaService_ReportSystemState_Handler,
		},
		{
			MethodName: "ReportSystemInfo",
			Handler:    _NezhaService_ReportSystemInfo_Handler,
		},
		{
			MethodName: "ReportTask",
			Handler:    _NezhaService_ReportTask_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "RequestTask",
			Handler:       _NezhaService_RequestTask_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/nezha.proto",
}

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

Functions

func RegisterNezhaServiceServer

func RegisterNezhaServiceServer(s grpc.ServiceRegistrar, srv NezhaServiceServer)

Types

type Host

type Host struct {
	Platform        string   `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"`
	PlatformVersion string   `protobuf:"bytes,2,opt,name=platform_version,json=platformVersion,proto3" json:"platform_version,omitempty"`
	Cpu             []string `protobuf:"bytes,3,rep,name=cpu,proto3" json:"cpu,omitempty"`
	MemTotal        uint64   `protobuf:"varint,4,opt,name=mem_total,json=memTotal,proto3" json:"mem_total,omitempty"`
	DiskTotal       uint64   `protobuf:"varint,5,opt,name=disk_total,json=diskTotal,proto3" json:"disk_total,omitempty"`
	SwapTotal       uint64   `protobuf:"varint,6,opt,name=swap_total,json=swapTotal,proto3" json:"swap_total,omitempty"`
	Arch            string   `protobuf:"bytes,7,opt,name=arch,proto3" json:"arch,omitempty"`
	Virtualization  string   `protobuf:"bytes,8,opt,name=virtualization,proto3" json:"virtualization,omitempty"`
	BootTime        uint64   `protobuf:"varint,9,opt,name=boot_time,json=bootTime,proto3" json:"boot_time,omitempty"`
	Ip              string   `protobuf:"bytes,10,opt,name=ip,proto3" json:"ip,omitempty"`
	CountryCode     string   `protobuf:"bytes,11,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
	Version         string   `protobuf:"bytes,12,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*Host) Descriptor deprecated

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

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetArch

func (x *Host) GetArch() string

func (*Host) GetBootTime

func (x *Host) GetBootTime() uint64

func (*Host) GetCountryCode

func (x *Host) GetCountryCode() string

func (*Host) GetCpu

func (x *Host) GetCpu() []string

func (*Host) GetDiskTotal

func (x *Host) GetDiskTotal() uint64

func (*Host) GetIp

func (x *Host) GetIp() string

func (*Host) GetMemTotal

func (x *Host) GetMemTotal() uint64

func (*Host) GetPlatform

func (x *Host) GetPlatform() string

func (*Host) GetPlatformVersion

func (x *Host) GetPlatformVersion() string

func (*Host) GetSwapTotal

func (x *Host) GetSwapTotal() uint64

func (*Host) GetVersion

func (x *Host) GetVersion() string

func (*Host) GetVirtualization

func (x *Host) GetVirtualization() string

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) ProtoReflect

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

func (*Host) Reset

func (x *Host) Reset()

func (*Host) String

func (x *Host) String() string

type NezhaServiceClient

type NezhaServiceClient interface {
	ReportSystemState(ctx context.Context, in *State, opts ...grpc.CallOption) (*Receipt, error)
	ReportSystemInfo(ctx context.Context, in *Host, opts ...grpc.CallOption) (*Receipt, error)
	ReportTask(ctx context.Context, in *TaskResult, opts ...grpc.CallOption) (*Receipt, error)
	RequestTask(ctx context.Context, in *Host, opts ...grpc.CallOption) (NezhaService_RequestTaskClient, error)
}

NezhaServiceClient is the client API for NezhaService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type NezhaServiceServer

type NezhaServiceServer interface {
	ReportSystemState(context.Context, *State) (*Receipt, error)
	ReportSystemInfo(context.Context, *Host) (*Receipt, error)
	ReportTask(context.Context, *TaskResult) (*Receipt, error)
	RequestTask(*Host, NezhaService_RequestTaskServer) error
}

NezhaServiceServer is the server API for NezhaService service. All implementations should embed UnimplementedNezhaServiceServer for forward compatibility

type NezhaService_RequestTaskClient

type NezhaService_RequestTaskClient interface {
	Recv() (*Task, error)
	grpc.ClientStream
}

type NezhaService_RequestTaskServer

type NezhaService_RequestTaskServer interface {
	Send(*Task) error
	grpc.ServerStream
}

type Receipt

type Receipt struct {
	Proced bool `protobuf:"varint,1,opt,name=proced,proto3" json:"proced,omitempty"`
	// contains filtered or unexported fields
}

func (*Receipt) Descriptor deprecated

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

Deprecated: Use Receipt.ProtoReflect.Descriptor instead.

func (*Receipt) GetProced

func (x *Receipt) GetProced() bool

func (*Receipt) ProtoMessage

func (*Receipt) ProtoMessage()

func (*Receipt) ProtoReflect

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

func (*Receipt) Reset

func (x *Receipt) Reset()

func (*Receipt) String

func (x *Receipt) String() string

type State

type State struct {
	Cpu            float64 `protobuf:"fixed64,1,opt,name=cpu,proto3" json:"cpu,omitempty"`
	MemUsed        uint64  `protobuf:"varint,3,opt,name=mem_used,json=memUsed,proto3" json:"mem_used,omitempty"`
	SwapUsed       uint64  `protobuf:"varint,4,opt,name=swap_used,json=swapUsed,proto3" json:"swap_used,omitempty"`
	DiskUsed       uint64  `protobuf:"varint,5,opt,name=disk_used,json=diskUsed,proto3" json:"disk_used,omitempty"`
	NetInTransfer  uint64  `protobuf:"varint,6,opt,name=net_in_transfer,json=netInTransfer,proto3" json:"net_in_transfer,omitempty"`
	NetOutTransfer uint64  `protobuf:"varint,7,opt,name=net_out_transfer,json=netOutTransfer,proto3" json:"net_out_transfer,omitempty"`
	NetInSpeed     uint64  `protobuf:"varint,8,opt,name=net_in_speed,json=netInSpeed,proto3" json:"net_in_speed,omitempty"`
	NetOutSpeed    uint64  `protobuf:"varint,9,opt,name=net_out_speed,json=netOutSpeed,proto3" json:"net_out_speed,omitempty"`
	Uptime         uint64  `protobuf:"varint,10,opt,name=uptime,proto3" json:"uptime,omitempty"`
	Load1          float64 `protobuf:"fixed64,11,opt,name=load1,proto3" json:"load1,omitempty"`
	Load5          float64 `protobuf:"fixed64,12,opt,name=load5,proto3" json:"load5,omitempty"`
	Load15         float64 `protobuf:"fixed64,13,opt,name=load15,proto3" json:"load15,omitempty"`
	TcpConnCount   uint64  `protobuf:"varint,14,opt,name=tcp_conn_count,json=tcpConnCount,proto3" json:"tcp_conn_count,omitempty"`
	UdpConnCount   uint64  `protobuf:"varint,15,opt,name=udp_conn_count,json=udpConnCount,proto3" json:"udp_conn_count,omitempty"`
	ProcessCount   uint64  `protobuf:"varint,16,opt,name=process_count,json=processCount,proto3" json:"process_count,omitempty"`
	// contains filtered or unexported fields
}

func (*State) Descriptor deprecated

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

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetCpu

func (x *State) GetCpu() float64

func (*State) GetDiskUsed

func (x *State) GetDiskUsed() uint64

func (*State) GetLoad1

func (x *State) GetLoad1() float64

func (*State) GetLoad15

func (x *State) GetLoad15() float64

func (*State) GetLoad5

func (x *State) GetLoad5() float64

func (*State) GetMemUsed

func (x *State) GetMemUsed() uint64

func (*State) GetNetInSpeed

func (x *State) GetNetInSpeed() uint64

func (*State) GetNetInTransfer

func (x *State) GetNetInTransfer() uint64

func (*State) GetNetOutSpeed

func (x *State) GetNetOutSpeed() uint64

func (*State) GetNetOutTransfer

func (x *State) GetNetOutTransfer() uint64

func (*State) GetProcessCount

func (x *State) GetProcessCount() uint64

func (*State) GetSwapUsed

func (x *State) GetSwapUsed() uint64

func (*State) GetTcpConnCount

func (x *State) GetTcpConnCount() uint64

func (*State) GetUdpConnCount

func (x *State) GetUdpConnCount() uint64

func (*State) GetUptime

func (x *State) GetUptime() uint64

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect

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

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type Task

type Task struct {
	Id   uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Type uint64 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Task) Descriptor deprecated

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetData

func (x *Task) GetData() string

func (*Task) GetId

func (x *Task) GetId() uint64

func (*Task) GetType

func (x *Task) GetType() uint64

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

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

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type TaskResult

type TaskResult struct {
	Id         uint64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Type       uint64  `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	Delay      float32 `protobuf:"fixed32,3,opt,name=delay,proto3" json:"delay,omitempty"`
	Data       string  `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	Successful bool    `protobuf:"varint,5,opt,name=successful,proto3" json:"successful,omitempty"`
	// contains filtered or unexported fields
}

func (*TaskResult) Descriptor deprecated

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

Deprecated: Use TaskResult.ProtoReflect.Descriptor instead.

func (*TaskResult) GetData

func (x *TaskResult) GetData() string

func (*TaskResult) GetDelay

func (x *TaskResult) GetDelay() float32

func (*TaskResult) GetId

func (x *TaskResult) GetId() uint64

func (*TaskResult) GetSuccessful

func (x *TaskResult) GetSuccessful() bool

func (*TaskResult) GetType

func (x *TaskResult) GetType() uint64

func (*TaskResult) ProtoMessage

func (*TaskResult) ProtoMessage()

func (*TaskResult) ProtoReflect

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

func (*TaskResult) Reset

func (x *TaskResult) Reset()

func (*TaskResult) String

func (x *TaskResult) String() string

type UnimplementedNezhaServiceServer

type UnimplementedNezhaServiceServer struct {
}

UnimplementedNezhaServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedNezhaServiceServer) ReportSystemInfo

func (UnimplementedNezhaServiceServer) ReportSystemState

func (UnimplementedNezhaServiceServer) ReportTask

func (UnimplementedNezhaServiceServer) RequestTask

type UnsafeNezhaServiceServer

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

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

Jump to

Keyboard shortcuts

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