Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterNezhaServiceServer(s grpc.ServiceRegistrar, srv NezhaServiceServer)
- type GeoIP
- type Host
- func (*Host) Descriptor() ([]byte, []int)deprecated
- func (x *Host) GetArch() string
- func (x *Host) GetBootTime() uint64
- func (x *Host) GetCpu() []string
- func (x *Host) GetDiskTotal() uint64
- func (x *Host) GetGpu() []string
- func (x *Host) GetMemTotal() uint64
- func (x *Host) GetPlatform() string
- func (x *Host) GetPlatformVersion() string
- func (x *Host) GetSwapTotal() uint64
- func (x *Host) GetVersion() string
- func (x *Host) GetVirtualization() string
- func (*Host) ProtoMessage()
- func (x *Host) ProtoReflect() protoreflect.Message
- func (x *Host) Reset()
- func (x *Host) String() string
- type IOStreamData
- type IP
- type NezhaServiceClient
- type NezhaServiceServer
- type NezhaService_IOStreamClient
- type NezhaService_IOStreamServer
- type NezhaService_ReportSystemStateClient
- type NezhaService_ReportSystemStateServer
- type NezhaService_RequestTaskClient
- type NezhaService_RequestTaskServer
- type Receipt
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetCpu() float64
- func (x *State) GetDiskUsed() uint64
- func (x *State) GetGpu() []float64
- func (x *State) GetLoad1() float64
- func (x *State) GetLoad15() float64
- func (x *State) GetLoad5() float64
- func (x *State) GetMemUsed() uint64
- func (x *State) GetNetInSpeed() uint64
- func (x *State) GetNetInTransfer() uint64
- func (x *State) GetNetOutSpeed() uint64
- func (x *State) GetNetOutTransfer() uint64
- func (x *State) GetProcessCount() uint64
- func (x *State) GetSwapUsed() uint64
- func (x *State) GetTcpConnCount() uint64
- func (x *State) GetTemperatures() []*State_SensorTemperature
- func (x *State) GetUdpConnCount() uint64
- func (x *State) GetUptime() uint64
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type State_SensorTemperature
- func (*State_SensorTemperature) Descriptor() ([]byte, []int)deprecated
- func (x *State_SensorTemperature) GetName() string
- func (x *State_SensorTemperature) GetTemperature() float64
- func (*State_SensorTemperature) ProtoMessage()
- func (x *State_SensorTemperature) ProtoReflect() protoreflect.Message
- func (x *State_SensorTemperature) Reset()
- func (x *State_SensorTemperature) String() string
- type Task
- type TaskResult
- func (*TaskResult) Descriptor() ([]byte, []int)deprecated
- func (x *TaskResult) GetData() string
- func (x *TaskResult) GetDelay() float32
- func (x *TaskResult) GetId() uint64
- func (x *TaskResult) GetSuccessful() bool
- func (x *TaskResult) GetType() uint64
- func (*TaskResult) ProtoMessage()
- func (x *TaskResult) ProtoReflect() protoreflect.Message
- func (x *TaskResult) Reset()
- func (x *TaskResult) String() string
- type Uint64Receipt
- type UnimplementedNezhaServiceServer
- func (UnimplementedNezhaServiceServer) IOStream(NezhaService_IOStreamServer) error
- func (UnimplementedNezhaServiceServer) ReportGeoIP(context.Context, *GeoIP) (*GeoIP, error)
- func (UnimplementedNezhaServiceServer) ReportSystemInfo(context.Context, *Host) (*Receipt, error)
- func (UnimplementedNezhaServiceServer) ReportSystemInfo2(context.Context, *Host) (*Uint64Receipt, error)
- func (UnimplementedNezhaServiceServer) ReportSystemState(NezhaService_ReportSystemStateServer) error
- func (UnimplementedNezhaServiceServer) RequestTask(NezhaService_RequestTaskServer) error
- type UnsafeNezhaServiceServer
Constants ¶
const ( NezhaService_ReportSystemState_FullMethodName = "/proto.NezhaService/ReportSystemState" NezhaService_ReportSystemInfo_FullMethodName = "/proto.NezhaService/ReportSystemInfo" NezhaService_RequestTask_FullMethodName = "/proto.NezhaService/RequestTask" NezhaService_IOStream_FullMethodName = "/proto.NezhaService/IOStream" NezhaService_ReportGeoIP_FullMethodName = "/proto.NezhaService/ReportGeoIP" NezhaService_ReportSystemInfo2_FullMethodName = "/proto.NezhaService/ReportSystemInfo2" )
Variables ¶
var File_proto_nezha_proto protoreflect.FileDescriptor
var NezhaService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.NezhaService", HandlerType: (*NezhaServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ReportSystemInfo", Handler: _NezhaService_ReportSystemInfo_Handler, }, { MethodName: "ReportGeoIP", Handler: _NezhaService_ReportGeoIP_Handler, }, { MethodName: "ReportSystemInfo2", Handler: _NezhaService_ReportSystemInfo2_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ReportSystemState", Handler: _NezhaService_ReportSystemState_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "RequestTask", Handler: _NezhaService_RequestTask_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "IOStream", Handler: _NezhaService_IOStream_Handler, ServerStreams: true, ClientStreams: 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 GeoIP ¶
type GeoIP struct { Use6 bool `protobuf:"varint,1,opt,name=use6,proto3" json:"use6,omitempty"` Ip *IP `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` CountryCode string `protobuf:"bytes,3,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` // contains filtered or unexported fields }
func (*GeoIP) Descriptor
deprecated
func (*GeoIP) GetCountryCode ¶
func (*GeoIP) ProtoMessage ¶
func (*GeoIP) ProtoMessage()
func (*GeoIP) ProtoReflect ¶
func (x *GeoIP) ProtoReflect() protoreflect.Message
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"` Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"` Gpu []string `protobuf:"bytes,11,rep,name=gpu,proto3" json:"gpu,omitempty"` // contains filtered or unexported fields }
func (*Host) Descriptor
deprecated
func (*Host) GetBootTime ¶
func (*Host) GetDiskTotal ¶
func (*Host) GetMemTotal ¶
func (*Host) GetPlatform ¶
func (*Host) GetPlatformVersion ¶
func (*Host) GetSwapTotal ¶
func (*Host) GetVersion ¶
func (*Host) GetVirtualization ¶
func (*Host) ProtoMessage ¶
func (*Host) ProtoMessage()
func (*Host) ProtoReflect ¶
func (x *Host) ProtoReflect() protoreflect.Message
type IOStreamData ¶
type IOStreamData struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*IOStreamData) Descriptor
deprecated
func (*IOStreamData) Descriptor() ([]byte, []int)
Deprecated: Use IOStreamData.ProtoReflect.Descriptor instead.
func (*IOStreamData) GetData ¶
func (x *IOStreamData) GetData() []byte
func (*IOStreamData) ProtoMessage ¶
func (*IOStreamData) ProtoMessage()
func (*IOStreamData) ProtoReflect ¶
func (x *IOStreamData) ProtoReflect() protoreflect.Message
func (*IOStreamData) Reset ¶
func (x *IOStreamData) Reset()
func (*IOStreamData) String ¶
func (x *IOStreamData) String() string
type IP ¶
type IP struct { Ipv4 string `protobuf:"bytes,1,opt,name=ipv4,proto3" json:"ipv4,omitempty"` Ipv6 string `protobuf:"bytes,2,opt,name=ipv6,proto3" json:"ipv6,omitempty"` // contains filtered or unexported fields }
func (*IP) Descriptor
deprecated
func (*IP) ProtoMessage ¶
func (*IP) ProtoMessage()
func (*IP) ProtoReflect ¶
func (x *IP) ProtoReflect() protoreflect.Message
type NezhaServiceClient ¶
type NezhaServiceClient interface { ReportSystemState(ctx context.Context, opts ...grpc.CallOption) (NezhaService_ReportSystemStateClient, error) ReportSystemInfo(ctx context.Context, in *Host, opts ...grpc.CallOption) (*Receipt, error) RequestTask(ctx context.Context, opts ...grpc.CallOption) (NezhaService_RequestTaskClient, error) IOStream(ctx context.Context, opts ...grpc.CallOption) (NezhaService_IOStreamClient, error) ReportGeoIP(ctx context.Context, in *GeoIP, opts ...grpc.CallOption) (*GeoIP, error) ReportSystemInfo2(ctx context.Context, in *Host, opts ...grpc.CallOption) (*Uint64Receipt, error) }
NezhaServiceClient is the client API for NezhaService 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 NewNezhaServiceClient ¶
func NewNezhaServiceClient(cc grpc.ClientConnInterface) NezhaServiceClient
type NezhaServiceServer ¶
type NezhaServiceServer interface { ReportSystemState(NezhaService_ReportSystemStateServer) error ReportSystemInfo(context.Context, *Host) (*Receipt, error) RequestTask(NezhaService_RequestTaskServer) error IOStream(NezhaService_IOStreamServer) error ReportGeoIP(context.Context, *GeoIP) (*GeoIP, error) ReportSystemInfo2(context.Context, *Host) (*Uint64Receipt, error) }
NezhaServiceServer is the server API for NezhaService service. All implementations should embed UnimplementedNezhaServiceServer for forward compatibility
type NezhaService_IOStreamClient ¶
type NezhaService_IOStreamClient interface { Send(*IOStreamData) error Recv() (*IOStreamData, error) grpc.ClientStream }
type NezhaService_IOStreamServer ¶
type NezhaService_IOStreamServer interface { Send(*IOStreamData) error Recv() (*IOStreamData, error) grpc.ServerStream }
type NezhaService_RequestTaskClient ¶
type NezhaService_RequestTaskClient interface { Send(*TaskResult) error Recv() (*Task, error) grpc.ClientStream }
type NezhaService_RequestTaskServer ¶
type NezhaService_RequestTaskServer interface { Send(*Task) error Recv() (*TaskResult, 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) ProtoMessage ¶
func (*Receipt) ProtoMessage()
func (*Receipt) ProtoReflect ¶
func (x *Receipt) ProtoReflect() protoreflect.Message
type State ¶
type State struct { Cpu float64 `protobuf:"fixed64,1,opt,name=cpu,proto3" json:"cpu,omitempty"` MemUsed uint64 `protobuf:"varint,2,opt,name=mem_used,json=memUsed,proto3" json:"mem_used,omitempty"` SwapUsed uint64 `protobuf:"varint,3,opt,name=swap_used,json=swapUsed,proto3" json:"swap_used,omitempty"` DiskUsed uint64 `protobuf:"varint,4,opt,name=disk_used,json=diskUsed,proto3" json:"disk_used,omitempty"` NetInTransfer uint64 `protobuf:"varint,5,opt,name=net_in_transfer,json=netInTransfer,proto3" json:"net_in_transfer,omitempty"` NetOutTransfer uint64 `protobuf:"varint,6,opt,name=net_out_transfer,json=netOutTransfer,proto3" json:"net_out_transfer,omitempty"` NetInSpeed uint64 `protobuf:"varint,7,opt,name=net_in_speed,json=netInSpeed,proto3" json:"net_in_speed,omitempty"` NetOutSpeed uint64 `protobuf:"varint,8,opt,name=net_out_speed,json=netOutSpeed,proto3" json:"net_out_speed,omitempty"` Uptime uint64 `protobuf:"varint,9,opt,name=uptime,proto3" json:"uptime,omitempty"` Load1 float64 `protobuf:"fixed64,10,opt,name=load1,proto3" json:"load1,omitempty"` Load5 float64 `protobuf:"fixed64,11,opt,name=load5,proto3" json:"load5,omitempty"` Load15 float64 `protobuf:"fixed64,12,opt,name=load15,proto3" json:"load15,omitempty"` TcpConnCount uint64 `protobuf:"varint,13,opt,name=tcp_conn_count,json=tcpConnCount,proto3" json:"tcp_conn_count,omitempty"` UdpConnCount uint64 `protobuf:"varint,14,opt,name=udp_conn_count,json=udpConnCount,proto3" json:"udp_conn_count,omitempty"` ProcessCount uint64 `protobuf:"varint,15,opt,name=process_count,json=processCount,proto3" json:"process_count,omitempty"` Temperatures []*State_SensorTemperature `protobuf:"bytes,16,rep,name=temperatures,proto3" json:"temperatures,omitempty"` Gpu []float64 `protobuf:"fixed64,17,rep,packed,name=gpu,proto3" json:"gpu,omitempty"` // contains filtered or unexported fields }
func (*State) Descriptor
deprecated
func (*State) GetDiskUsed ¶
func (*State) GetMemUsed ¶
func (*State) GetNetInSpeed ¶
func (*State) GetNetInTransfer ¶
func (*State) GetNetOutSpeed ¶
func (*State) GetNetOutTransfer ¶
func (*State) GetProcessCount ¶
func (*State) GetSwapUsed ¶
func (*State) GetTcpConnCount ¶
func (*State) GetTemperatures ¶
func (x *State) GetTemperatures() []*State_SensorTemperature
func (*State) GetUdpConnCount ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
type State_SensorTemperature ¶
type State_SensorTemperature struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Temperature float64 `protobuf:"fixed64,2,opt,name=temperature,proto3" json:"temperature,omitempty"` // contains filtered or unexported fields }
func (*State_SensorTemperature) Descriptor
deprecated
func (*State_SensorTemperature) Descriptor() ([]byte, []int)
Deprecated: Use State_SensorTemperature.ProtoReflect.Descriptor instead.
func (*State_SensorTemperature) GetName ¶
func (x *State_SensorTemperature) GetName() string
func (*State_SensorTemperature) GetTemperature ¶
func (x *State_SensorTemperature) GetTemperature() float64
func (*State_SensorTemperature) ProtoMessage ¶
func (*State_SensorTemperature) ProtoMessage()
func (*State_SensorTemperature) ProtoReflect ¶
func (x *State_SensorTemperature) ProtoReflect() protoreflect.Message
func (*State_SensorTemperature) Reset ¶
func (x *State_SensorTemperature) Reset()
func (*State_SensorTemperature) String ¶
func (x *State_SensorTemperature) 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) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶
func (x *Task) ProtoReflect() protoreflect.Message
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 Uint64Receipt ¶ added in v1.1.2
type Uint64Receipt struct { Data uint64 `protobuf:"varint,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Uint64Receipt) Descriptor
deprecated
added in
v1.1.2
func (*Uint64Receipt) Descriptor() ([]byte, []int)
Deprecated: Use Uint64Receipt.ProtoReflect.Descriptor instead.
func (*Uint64Receipt) GetData ¶ added in v1.1.2
func (x *Uint64Receipt) GetData() uint64
func (*Uint64Receipt) ProtoMessage ¶ added in v1.1.2
func (*Uint64Receipt) ProtoMessage()
func (*Uint64Receipt) ProtoReflect ¶ added in v1.1.2
func (x *Uint64Receipt) ProtoReflect() protoreflect.Message
func (*Uint64Receipt) Reset ¶ added in v1.1.2
func (x *Uint64Receipt) Reset()
func (*Uint64Receipt) String ¶ added in v1.1.2
func (x *Uint64Receipt) String() string
type UnimplementedNezhaServiceServer ¶
type UnimplementedNezhaServiceServer struct { }
UnimplementedNezhaServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedNezhaServiceServer) IOStream ¶
func (UnimplementedNezhaServiceServer) IOStream(NezhaService_IOStreamServer) error
func (UnimplementedNezhaServiceServer) ReportGeoIP ¶
func (UnimplementedNezhaServiceServer) ReportSystemInfo ¶
func (UnimplementedNezhaServiceServer) ReportSystemInfo2 ¶ added in v1.1.1
func (UnimplementedNezhaServiceServer) ReportSystemInfo2(context.Context, *Host) (*Uint64Receipt, error)
func (UnimplementedNezhaServiceServer) ReportSystemState ¶
func (UnimplementedNezhaServiceServer) ReportSystemState(NezhaService_ReportSystemStateServer) error
func (UnimplementedNezhaServiceServer) RequestTask ¶
func (UnimplementedNezhaServiceServer) RequestTask(NezhaService_RequestTaskServer) error
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.