service

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connections_Conns_FullMethodName     = "/yuhaiin.protos.statistic.service.connections/conns"
	Connections_CloseConn_FullMethodName = "/yuhaiin.protos.statistic.service.connections/close_conn"
	Connections_Total_FullMethodName     = "/yuhaiin.protos.statistic.service.connections/total"
	Connections_Notify_FullMethodName    = "/yuhaiin.protos.statistic.service.connections/notify"
)

Variables

View Source
var Connections_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yuhaiin.protos.statistic.service.connections",
	HandlerType: (*ConnectionsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "conns",
			Handler:    _Connections_Conns_Handler,
		},
		{
			MethodName: "close_conn",
			Handler:    _Connections_CloseConn_Handler,
		},
		{
			MethodName: "total",
			Handler:    _Connections_Total_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "notify",
			Handler:       _Connections_Notify_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "statistic/grpc/config.proto",
}

Connections_ServiceDesc is the grpc.ServiceDesc for Connections 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_statistic_grpc_config_proto protoreflect.FileDescriptor

Functions

func RegisterConnectionsServer

func RegisterConnectionsServer(s grpc.ServiceRegistrar, srv ConnectionsServer)

Types

type ConnectionsClient

type ConnectionsClient interface {
	Conns(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NotifyNewConnections, error)
	CloseConn(ctx context.Context, in *NotifyRemoveConnections, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Total(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TotalFlow, error)
	Notify(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Connections_NotifyClient, error)
}

ConnectionsClient is the client API for Connections 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 ConnectionsServer

type ConnectionsServer interface {
	Conns(context.Context, *emptypb.Empty) (*NotifyNewConnections, error)
	CloseConn(context.Context, *NotifyRemoveConnections) (*emptypb.Empty, error)
	Total(context.Context, *emptypb.Empty) (*TotalFlow, error)
	Notify(*emptypb.Empty, Connections_NotifyServer) error
	// contains filtered or unexported methods
}

ConnectionsServer is the server API for Connections service. All implementations must embed UnimplementedConnectionsServer for forward compatibility

type Connections_NotifyClient

type Connections_NotifyClient interface {
	Recv() (*NotifyData, error)
	grpc.ClientStream
}

type Connections_NotifyServer

type Connections_NotifyServer interface {
	Send(*NotifyData) error
	grpc.ServerStream
}

type NotifyData

type NotifyData struct {

	// Types that are assignable to Data:
	//
	//	*NotifyData_TotalFlow
	//	*NotifyData_NotifyNewConnections
	//	*NotifyData_NotifyRemoveConnections
	Data isNotifyData_Data `protobuf_oneof:"data"`
	// contains filtered or unexported fields
}

func (*NotifyData) Descriptor deprecated

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

Deprecated: Use NotifyData.ProtoReflect.Descriptor instead.

func (*NotifyData) GetData

func (m *NotifyData) GetData() isNotifyData_Data

func (*NotifyData) GetNotifyNewConnections

func (x *NotifyData) GetNotifyNewConnections() *NotifyNewConnections

func (*NotifyData) GetNotifyRemoveConnections

func (x *NotifyData) GetNotifyRemoveConnections() *NotifyRemoveConnections

func (*NotifyData) GetTotalFlow

func (x *NotifyData) GetTotalFlow() *TotalFlow

func (*NotifyData) ProtoMessage

func (*NotifyData) ProtoMessage()

func (*NotifyData) ProtoReflect

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

func (*NotifyData) Reset

func (x *NotifyData) Reset()

func (*NotifyData) String

func (x *NotifyData) String() string

type NotifyData_NotifyNewConnections

type NotifyData_NotifyNewConnections struct {
	NotifyNewConnections *NotifyNewConnections `protobuf:"bytes,1,opt,name=notify_new_connections,json=notifyNewConnections,proto3,oneof"`
}

type NotifyData_NotifyRemoveConnections

type NotifyData_NotifyRemoveConnections struct {
	NotifyRemoveConnections *NotifyRemoveConnections `protobuf:"bytes,2,opt,name=notify_remove_connections,json=notifyRemoveConnections,proto3,oneof"`
}

type NotifyData_TotalFlow

type NotifyData_TotalFlow struct {
	TotalFlow *TotalFlow `protobuf:"bytes,3,opt,name=total_flow,json=totalFlow,proto3,oneof"`
}

type NotifyNewConnections

type NotifyNewConnections struct {
	Connections []*statistic.Connection `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyNewConnections) Descriptor deprecated

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

Deprecated: Use NotifyNewConnections.ProtoReflect.Descriptor instead.

func (*NotifyNewConnections) GetConnections

func (x *NotifyNewConnections) GetConnections() []*statistic.Connection

func (*NotifyNewConnections) ProtoMessage

func (*NotifyNewConnections) ProtoMessage()

func (*NotifyNewConnections) ProtoReflect

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

func (*NotifyNewConnections) Reset

func (x *NotifyNewConnections) Reset()

func (*NotifyNewConnections) String

func (x *NotifyNewConnections) String() string

type NotifyRemoveConnections

type NotifyRemoveConnections struct {
	Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyRemoveConnections) Descriptor deprecated

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

Deprecated: Use NotifyRemoveConnections.ProtoReflect.Descriptor instead.

func (*NotifyRemoveConnections) GetIds

func (x *NotifyRemoveConnections) GetIds() []uint64

func (*NotifyRemoveConnections) ProtoMessage

func (*NotifyRemoveConnections) ProtoMessage()

func (*NotifyRemoveConnections) ProtoReflect

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

func (*NotifyRemoveConnections) Reset

func (x *NotifyRemoveConnections) Reset()

func (*NotifyRemoveConnections) String

func (x *NotifyRemoveConnections) String() string

type TotalFlow

type TotalFlow struct {
	Download uint64 `protobuf:"varint,1,opt,name=download,proto3" json:"download,omitempty"`
	Upload   uint64 `protobuf:"varint,2,opt,name=upload,proto3" json:"upload,omitempty"`
	// contains filtered or unexported fields
}

func (*TotalFlow) Descriptor deprecated

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

Deprecated: Use TotalFlow.ProtoReflect.Descriptor instead.

func (*TotalFlow) GetDownload

func (x *TotalFlow) GetDownload() uint64

func (*TotalFlow) GetUpload

func (x *TotalFlow) GetUpload() uint64

func (*TotalFlow) ProtoMessage

func (*TotalFlow) ProtoMessage()

func (*TotalFlow) ProtoReflect

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

func (*TotalFlow) Reset

func (x *TotalFlow) Reset()

func (*TotalFlow) String

func (x *TotalFlow) String() string

type UnimplementedConnectionsServer

type UnimplementedConnectionsServer struct {
}

UnimplementedConnectionsServer must be embedded to have forward compatible implementations.

func (UnimplementedConnectionsServer) CloseConn

func (UnimplementedConnectionsServer) Conns

func (UnimplementedConnectionsServer) Notify

func (UnimplementedConnectionsServer) Total

type UnsafeConnectionsServer

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

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

Jump to

Keyboard shortcuts

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