service

package
v0.3.1-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NowReqNetType_name = map[int32]string{
		0: "reserve",
		1: "tcp",
		2: "udp",
	}
	NowReqNetType_value = map[string]int32{
		"reserve": 0,
		"tcp":     1,
		"udp":     2,
	}
)

Enum value maps for NowReqNetType.

View Source
var File_node_grpc_node_proto protoreflect.FileDescriptor
View Source
var Node_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yuhaiin.protos.node.service.node",
	HandlerType: (*NodeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "now",
			Handler:    _Node_Now_Handler,
		},
		{
			MethodName: "use",
			Handler:    _Node_Use_Handler,
		},
		{
			MethodName: "get",
			Handler:    _Node_Get_Handler,
		},
		{
			MethodName: "save",
			Handler:    _Node_Save_Handler,
		},
		{
			MethodName: "remove",
			Handler:    _Node_Remove_Handler,
		},
		{
			MethodName: "manager",
			Handler:    _Node_Manager_Handler,
		},
		{
			MethodName: "latency",
			Handler:    _Node_Latency_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "node/grpc/node.proto",
}

Node_ServiceDesc is the grpc.ServiceDesc for Node 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 Subscribe_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yuhaiin.protos.node.service.subscribe",
	HandlerType: (*SubscribeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "save",
			Handler:    _Subscribe_Save_Handler,
		},
		{
			MethodName: "remove",
			Handler:    _Subscribe_Remove_Handler,
		},
		{
			MethodName: "update",
			Handler:    _Subscribe_Update_Handler,
		},
		{
			MethodName: "get",
			Handler:    _Subscribe_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "node/grpc/node.proto",
}

Subscribe_ServiceDesc is the grpc.ServiceDesc for Subscribe 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 Tag_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yuhaiin.protos.node.service.tag",
	HandlerType: (*TagServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "save",
			Handler:    _Tag_Save_Handler,
		},
		{
			MethodName: "remove",
			Handler:    _Tag_Remove_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "node/grpc/node.proto",
}

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

Functions

func RegisterNodeServer

func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)

func RegisterSubscribeServer

func RegisterSubscribeServer(s grpc.ServiceRegistrar, srv SubscribeServer)

func RegisterTagServer

func RegisterTagServer(s grpc.ServiceRegistrar, srv TagServer)

Types

type GetLinksResp

type GetLinksResp struct {
	Links map[string]*subscribe.Link `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetLinksResp) Descriptor deprecated

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

Deprecated: Use GetLinksResp.ProtoReflect.Descriptor instead.

func (x *GetLinksResp) GetLinks() map[string]*subscribe.Link

func (*GetLinksResp) ProtoMessage

func (*GetLinksResp) ProtoMessage()

func (*GetLinksResp) ProtoReflect

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

func (*GetLinksResp) Reset

func (x *GetLinksResp) Reset()

func (*GetLinksResp) String

func (x *GetLinksResp) String() string

type LinkReq

type LinkReq struct {
	Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
	// contains filtered or unexported fields
}

func (*LinkReq) Descriptor deprecated

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

Deprecated: Use LinkReq.ProtoReflect.Descriptor instead.

func (*LinkReq) GetNames

func (x *LinkReq) GetNames() []string

func (*LinkReq) ProtoMessage

func (*LinkReq) ProtoMessage()

func (*LinkReq) ProtoReflect

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

func (*LinkReq) Reset

func (x *LinkReq) Reset()

func (*LinkReq) String

func (x *LinkReq) String() string

type NodeClient

type NodeClient interface {
	Now(ctx context.Context, in *NowReq, opts ...grpc.CallOption) (*point.Point, error)
	// use req is hash string of point
	Use(ctx context.Context, in *UseReq, opts ...grpc.CallOption) (*point.Point, error)
	Get(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*point.Point, error)
	Save(ctx context.Context, in *point.Point, opts ...grpc.CallOption) (*point.Point, error)
	Remove(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Manager(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*node.Manager, error)
	Latency(ctx context.Context, in *latency.Requests, opts ...grpc.CallOption) (*latency.Response, error)
}

NodeClient is the client API for Node 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 NewNodeClient

func NewNodeClient(cc grpc.ClientConnInterface) NodeClient

type NodeServer

type NodeServer interface {
	Now(context.Context, *NowReq) (*point.Point, error)
	// use req is hash string of point
	Use(context.Context, *UseReq) (*point.Point, error)
	Get(context.Context, *wrapperspb.StringValue) (*point.Point, error)
	Save(context.Context, *point.Point) (*point.Point, error)
	Remove(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
	Manager(context.Context, *wrapperspb.StringValue) (*node.Manager, error)
	Latency(context.Context, *latency.Requests) (*latency.Response, error)
	// contains filtered or unexported methods
}

NodeServer is the server API for Node service. All implementations must embed UnimplementedNodeServer for forward compatibility

type NowReq

type NowReq struct {
	Net NowReqNetType `protobuf:"varint,1,opt,name=net,json=type,proto3,enum=yuhaiin.protos.node.service.NowReqNetType" json:"net,omitempty"`
	// contains filtered or unexported fields
}

func (*NowReq) Descriptor deprecated

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

Deprecated: Use NowReq.ProtoReflect.Descriptor instead.

func (*NowReq) GetNet

func (x *NowReq) GetNet() NowReqNetType

func (*NowReq) ProtoMessage

func (*NowReq) ProtoMessage()

func (*NowReq) ProtoReflect

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

func (*NowReq) Reset

func (x *NowReq) Reset()

func (*NowReq) String

func (x *NowReq) String() string

type NowReqNetType

type NowReqNetType int32
const (
	NowReq_reserve NowReqNetType = 0
	NowReq_tcp     NowReqNetType = 1
	NowReq_udp     NowReqNetType = 2
)

func (NowReqNetType) Descriptor

func (NowReqNetType) Enum

func (x NowReqNetType) Enum() *NowReqNetType

func (NowReqNetType) EnumDescriptor deprecated

func (NowReqNetType) EnumDescriptor() ([]byte, []int)

Deprecated: Use NowReqNetType.Descriptor instead.

func (NowReqNetType) Number

func (NowReqNetType) String

func (x NowReqNetType) String() string

func (NowReqNetType) Type

type SaveLinkReq

type SaveLinkReq struct {
	Links []*subscribe.Link `protobuf:"bytes,1,rep,name=links,proto3" json:"links,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveLinkReq) Descriptor deprecated

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

Deprecated: Use SaveLinkReq.ProtoReflect.Descriptor instead.

func (x *SaveLinkReq) GetLinks() []*subscribe.Link

func (*SaveLinkReq) ProtoMessage

func (*SaveLinkReq) ProtoMessage()

func (*SaveLinkReq) ProtoReflect

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

func (*SaveLinkReq) Reset

func (x *SaveLinkReq) Reset()

func (*SaveLinkReq) String

func (x *SaveLinkReq) String() string

type SaveTagReq

type SaveTagReq struct {
	Tag  string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveTagReq) Descriptor deprecated

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

Deprecated: Use SaveTagReq.ProtoReflect.Descriptor instead.

func (*SaveTagReq) GetHash

func (x *SaveTagReq) GetHash() string

func (*SaveTagReq) GetTag

func (x *SaveTagReq) GetTag() string

func (*SaveTagReq) ProtoMessage

func (*SaveTagReq) ProtoMessage()

func (*SaveTagReq) ProtoReflect

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

func (*SaveTagReq) Reset

func (x *SaveTagReq) Reset()

func (*SaveTagReq) String

func (x *SaveTagReq) String() string

type SubscribeClient

type SubscribeClient interface {
	Save(ctx context.Context, in *SaveLinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Remove(ctx context.Context, in *LinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Update(ctx context.Context, in *LinkReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetLinksResp, error)
}

SubscribeClient is the client API for Subscribe 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 NewSubscribeClient

func NewSubscribeClient(cc grpc.ClientConnInterface) SubscribeClient

type SubscribeServer

type SubscribeServer interface {
	Save(context.Context, *SaveLinkReq) (*emptypb.Empty, error)
	Remove(context.Context, *LinkReq) (*emptypb.Empty, error)
	Update(context.Context, *LinkReq) (*emptypb.Empty, error)
	Get(context.Context, *emptypb.Empty) (*GetLinksResp, error)
	// contains filtered or unexported methods
}

SubscribeServer is the server API for Subscribe service. All implementations must embed UnimplementedSubscribeServer for forward compatibility

type TagClient

type TagClient interface {
	Save(ctx context.Context, in *SaveTagReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Remove(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

TagClient is the client API for Tag 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 NewTagClient

func NewTagClient(cc grpc.ClientConnInterface) TagClient

type TagServer

type TagServer interface {
	Save(context.Context, *SaveTagReq) (*emptypb.Empty, error)
	Remove(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

TagServer is the server API for Tag service. All implementations must embed UnimplementedTagServer for forward compatibility

type UnimplementedNodeServer

type UnimplementedNodeServer struct {
}

UnimplementedNodeServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeServer) Get

func (UnimplementedNodeServer) Latency

func (UnimplementedNodeServer) Manager

func (UnimplementedNodeServer) Now

func (UnimplementedNodeServer) Remove

func (UnimplementedNodeServer) Save

func (UnimplementedNodeServer) Use

type UnimplementedSubscribeServer

type UnimplementedSubscribeServer struct {
}

UnimplementedSubscribeServer must be embedded to have forward compatible implementations.

func (UnimplementedSubscribeServer) Get

func (UnimplementedSubscribeServer) Remove

func (UnimplementedSubscribeServer) Save

func (UnimplementedSubscribeServer) Update

type UnimplementedTagServer

type UnimplementedTagServer struct {
}

UnimplementedTagServer must be embedded to have forward compatible implementations.

func (UnimplementedTagServer) Remove

func (UnimplementedTagServer) Save

type UnsafeNodeServer

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

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

type UnsafeSubscribeServer

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

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

type UnsafeTagServer

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

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

type UseReq

type UseReq struct {
	Tcp  bool   `protobuf:"varint,1,opt,name=tcp,proto3" json:"tcp,omitempty"`
	Udp  bool   `protobuf:"varint,2,opt,name=udp,proto3" json:"udp,omitempty"`
	Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*UseReq) Descriptor deprecated

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

Deprecated: Use UseReq.ProtoReflect.Descriptor instead.

func (*UseReq) GetHash

func (x *UseReq) GetHash() string

func (*UseReq) GetTcp

func (x *UseReq) GetTcp() bool

func (*UseReq) GetUdp

func (x *UseReq) GetUdp() bool

func (*UseReq) ProtoMessage

func (*UseReq) ProtoMessage()

func (*UseReq) ProtoReflect

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

func (*UseReq) Reset

func (x *UseReq) Reset()

func (*UseReq) String

func (x *UseReq) String() string

Jump to

Keyboard shortcuts

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