register

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package register is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Register_Register_FullMethodName    = "/service.collector.register.Register/Register"
	Register_GetRegister_FullMethodName = "/service.collector.register.Register/GetRegister"
	Register_Unregister_FullMethodName  = "/service.collector.register.Register/Unregister"
)

Variables

View Source
var File_register_register_proto protoreflect.FileDescriptor
View Source
var Register_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "service.collector.register.Register",
	HandlerType: (*RegisterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _Register_Register_Handler,
		},
		{
			MethodName: "GetRegister",
			Handler:    _Register_GetRegister_Handler,
		},
		{
			MethodName: "Unregister",
			Handler:    _Register_Unregister_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "register/register.proto",
}

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

Functions

func RegisterRegisterHandler

func RegisterRegisterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterRegisterHandler registers the http handlers for service Register to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterRegisterHandlerClient

func RegisterRegisterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RegisterClient) error

RegisterRegisterHandlerClient registers the http handlers for service Register to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RegisterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RegisterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RegisterClient" to call the correct interceptors.

func RegisterRegisterHandlerFromEndpoint

func RegisterRegisterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterRegisterHandlerFromEndpoint is same as RegisterRegisterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterRegisterHandlerServer

func RegisterRegisterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RegisterServer) error

RegisterRegisterHandlerServer registers the http handlers for service Register to "mux". UnaryRPC :call RegisterServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRegisterHandlerFromEndpoint instead.

func RegisterRegisterServer

func RegisterRegisterServer(s grpc.ServiceRegistrar, srv RegisterServer)

Types

type GetRegisterReply

type GetRegisterReply struct {
	Code    int32           `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string          `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Infos   []*RegisterInfo `protobuf:"bytes,3,rep,name=infos,proto3" json:"infos,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRegisterReply) Descriptor deprecated

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

Deprecated: Use GetRegisterReply.ProtoReflect.Descriptor instead.

func (*GetRegisterReply) GetCode

func (x *GetRegisterReply) GetCode() int32

func (*GetRegisterReply) GetInfos

func (x *GetRegisterReply) GetInfos() []*RegisterInfo

func (*GetRegisterReply) GetMessage

func (x *GetRegisterReply) GetMessage() string

func (*GetRegisterReply) ProtoMessage

func (*GetRegisterReply) ProtoMessage()

func (*GetRegisterReply) ProtoReflect

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

func (*GetRegisterReply) Reset

func (x *GetRegisterReply) Reset()

func (*GetRegisterReply) String

func (x *GetRegisterReply) String() string

type GetRegisterRequest

type GetRegisterRequest struct {
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRegisterRequest) Descriptor deprecated

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

Deprecated: Use GetRegisterRequest.ProtoReflect.Descriptor instead.

func (*GetRegisterRequest) GetAddress

func (x *GetRegisterRequest) GetAddress() string

func (*GetRegisterRequest) GetService

func (x *GetRegisterRequest) GetService() string

func (*GetRegisterRequest) ProtoMessage

func (*GetRegisterRequest) ProtoMessage()

func (*GetRegisterRequest) ProtoReflect

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

func (*GetRegisterRequest) Reset

func (x *GetRegisterRequest) Reset()

func (*GetRegisterRequest) String

func (x *GetRegisterRequest) String() string

type RegisterClient

type RegisterClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterReply, error)
	GetRegister(ctx context.Context, in *GetRegisterRequest, opts ...grpc.CallOption) (*GetRegisterReply, error)
	Unregister(ctx context.Context, in *UnregisterRequest, opts ...grpc.CallOption) (*UnregisterReply, error)
}

RegisterClient is the client API for Register 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 NewRegisterClient

func NewRegisterClient(cc grpc.ClientConnInterface) RegisterClient

type RegisterInfo

type RegisterInfo struct {
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterInfo) Descriptor deprecated

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

Deprecated: Use RegisterInfo.ProtoReflect.Descriptor instead.

func (*RegisterInfo) GetAddress

func (x *RegisterInfo) GetAddress() string

func (*RegisterInfo) GetService

func (x *RegisterInfo) GetService() string

func (*RegisterInfo) ProtoMessage

func (*RegisterInfo) ProtoMessage()

func (*RegisterInfo) ProtoReflect

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

func (*RegisterInfo) Reset

func (x *RegisterInfo) Reset()

func (*RegisterInfo) String

func (x *RegisterInfo) String() string

type RegisterReply

type RegisterReply struct {
	Code    int32         `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string        `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Info    *RegisterInfo `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterReply) Descriptor deprecated

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

Deprecated: Use RegisterReply.ProtoReflect.Descriptor instead.

func (*RegisterReply) GetCode

func (x *RegisterReply) GetCode() int32

func (*RegisterReply) GetInfo

func (x *RegisterReply) GetInfo() *RegisterInfo

func (*RegisterReply) GetMessage

func (x *RegisterReply) GetMessage() string

func (*RegisterReply) ProtoMessage

func (*RegisterReply) ProtoMessage()

func (*RegisterReply) ProtoReflect

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

func (*RegisterReply) Reset

func (x *RegisterReply) Reset()

func (*RegisterReply) String

func (x *RegisterReply) String() string

type RegisterRequest

type RegisterRequest struct {
	Verify  string `protobuf:"bytes,1,opt,name=verify,proto3" json:"verify,omitempty"` // 校验字段,防止gw转到非预期服务上
	Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetService

func (x *RegisterRequest) GetService() string

func (*RegisterRequest) GetVerify

func (x *RegisterRequest) GetVerify() string

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type RegisterServer

type RegisterServer interface {
	Register(context.Context, *RegisterRequest) (*RegisterReply, error)
	GetRegister(context.Context, *GetRegisterRequest) (*GetRegisterReply, error)
	Unregister(context.Context, *UnregisterRequest) (*UnregisterReply, error)
	// contains filtered or unexported methods
}

RegisterServer is the server API for Register service. All implementations must embed UnimplementedRegisterServer for forward compatibility

type UnimplementedRegisterServer

type UnimplementedRegisterServer struct {
}

UnimplementedRegisterServer must be embedded to have forward compatible implementations.

func (UnimplementedRegisterServer) GetRegister

func (UnimplementedRegisterServer) Register

func (UnimplementedRegisterServer) Unregister

type UnregisterReply

type UnregisterReply struct {
	Code    int32           `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string          `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Infos   []*RegisterInfo `protobuf:"bytes,3,rep,name=infos,proto3" json:"infos,omitempty"`
	// contains filtered or unexported fields
}

func (*UnregisterReply) Descriptor deprecated

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

Deprecated: Use UnregisterReply.ProtoReflect.Descriptor instead.

func (*UnregisterReply) GetCode

func (x *UnregisterReply) GetCode() int32

func (*UnregisterReply) GetInfos

func (x *UnregisterReply) GetInfos() []*RegisterInfo

func (*UnregisterReply) GetMessage

func (x *UnregisterReply) GetMessage() string

func (*UnregisterReply) ProtoMessage

func (*UnregisterReply) ProtoMessage()

func (*UnregisterReply) ProtoReflect

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

func (*UnregisterReply) Reset

func (x *UnregisterReply) Reset()

func (*UnregisterReply) String

func (x *UnregisterReply) String() string

type UnregisterRequest

type UnregisterRequest struct {
	Verify  string `protobuf:"bytes,1,opt,name=verify,proto3" json:"verify,omitempty"` // 校验字段,防止gw转到非预期服务上
	Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}

func (*UnregisterRequest) Descriptor deprecated

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

Deprecated: Use UnregisterRequest.ProtoReflect.Descriptor instead.

func (*UnregisterRequest) GetService

func (x *UnregisterRequest) GetService() string

func (*UnregisterRequest) GetVerify

func (x *UnregisterRequest) GetVerify() string

func (*UnregisterRequest) ProtoMessage

func (*UnregisterRequest) ProtoMessage()

func (*UnregisterRequest) ProtoReflect

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

func (*UnregisterRequest) Reset

func (x *UnregisterRequest) Reset()

func (*UnregisterRequest) String

func (x *UnregisterRequest) String() string

type UnsafeRegisterServer

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

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

Jump to

Keyboard shortcuts

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