proto

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 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_RequestTask_FullMethodName       = "/proto.NezhaService/RequestTask"
	NezhaService_IOStream_FullMethodName          = "/proto.NezhaService/IOStream"
	NezhaService_ReportGeoIP_FullMethodName       = "/proto.NezhaService/ReportGeoIP"
	NezhaService_ReportSystemInfo2_FullMethodName = "/proto.NezhaService/ReportSystemInfo2"
)

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: "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) Descriptor() ([]byte, []int)

Deprecated: Use GeoIP.ProtoReflect.Descriptor instead.

func (*GeoIP) GetCountryCode

func (x *GeoIP) GetCountryCode() string

func (*GeoIP) GetIp

func (x *GeoIP) GetIp() *IP

func (*GeoIP) GetUse6

func (x *GeoIP) GetUse6() bool

func (*GeoIP) ProtoMessage

func (*GeoIP) ProtoMessage()

func (*GeoIP) ProtoReflect

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

func (*GeoIP) Reset

func (x *GeoIP) Reset()

func (*GeoIP) String

func (x *GeoIP) String() string

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

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

func (*Host) GetDiskTotal

func (x *Host) GetDiskTotal() uint64

func (*Host) GetGpu

func (x *Host) GetGpu() []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 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) Descriptor() ([]byte, []int)

Deprecated: Use IP.ProtoReflect.Descriptor instead.

func (*IP) GetIpv4

func (x *IP) GetIpv4() string

func (*IP) GetIpv6

func (x *IP) GetIpv6() string

func (*IP) ProtoMessage

func (*IP) ProtoMessage()

func (*IP) ProtoReflect

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

func (*IP) Reset

func (x *IP) Reset()

func (*IP) String

func (x *IP) String() string

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.

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_ReportSystemStateClient

type NezhaService_ReportSystemStateClient interface {
	Send(*State) error
	Recv() (*Receipt, error)
	grpc.ClientStream
}

type NezhaService_ReportSystemStateServer

type NezhaService_ReportSystemStateServer interface {
	Send(*Receipt) error
	Recv() (*State, 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) 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,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) 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) GetGpu

func (x *State) GetGpu() []float64

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

func (x *State) GetTemperatures() []*State_SensorTemperature

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

func (UnimplementedNezhaServiceServer) ReportSystemInfo

func (UnimplementedNezhaServiceServer) ReportSystemInfo2 added in v1.1.1

func (UnimplementedNezhaServiceServer) ReportSystemState

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