Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type Endpoint
- func (*Endpoint) Descriptor() ([]byte, []int)deprecated
- func (x *Endpoint) GetAction() string
- func (x *Endpoint) GetLabels() map[string]string
- func (x *Endpoint) GetMethod() string
- func (x *Endpoint) GetPath() string
- func (x *Endpoint) GetResource() string
- func (*Endpoint) ProtoMessage()
- func (x *Endpoint) ProtoReflect() protoreflect.Message
- func (x *Endpoint) Reset()
- func (x *Endpoint) String() string
- type EndpointSet
- func (*EndpointSet) Descriptor() ([]byte, []int)deprecated
- func (x *EndpointSet) GetEndpoints() []*Endpoint
- func (x *EndpointSet) GetService() string
- func (*EndpointSet) ProtoMessage()
- func (x *EndpointSet) ProtoReflect() protoreflect.Message
- func (x *EndpointSet) Reset()
- func (x *EndpointSet) String() string
- func (s *EndpointSet) ToDocs() (docs []interface{})
- type RPCClient
- type RPCServer
- type RegistryResponse
- type Service
- type UnimplementedRPCServer
- type UnsafeRPCServer
Constants ¶
const (
AppName = "endpoint"
)
Variables ¶
var File_apps_endpoint_pb_endproto_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "keyauth.endpoint.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RegistryEndpoint", Handler: _RPC_RegistryEndpoint_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/endpoint/pb/endproto.proto", }
RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRPCServer ¶
func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
Types ¶
type Endpoint ¶
type Endpoint struct { // 资源名称, 路由装饰定义 // @gotags: json:"resource" bson:"resource" Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource" bson:"resource"` // 资源操作方法 // @gotags: json:"action" bson:"action" Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action" bson:"action"` // 该接口的标签, 该功能的标签 // @gotags: json:"labels" bson:"labels" Labels map[string]string `` /* 157-byte string literal not displayed */ // HTTP 路由定义 // @gotags: json:"path" bson:"path" Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path" bson:"path"` // HTTP 路由定义 // @gotags: json:"method" bson:"method" Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method" bson:"method"` // contains filtered or unexported fields }
服务功能
func (*Endpoint) Descriptor
deprecated
func (*Endpoint) GetResource ¶
func (*Endpoint) ProtoMessage ¶
func (*Endpoint) ProtoMessage()
func (*Endpoint) ProtoReflect ¶
func (x *Endpoint) ProtoReflect() protoreflect.Message
type EndpointSet ¶
type EndpointSet struct { // 服务名称 // @gotags: json:"service" bson:"service" Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service" bson:"service"` // 服务功能 // @gotags: json:"endpoints" bson:"endpoints" Endpoints []*Endpoint `protobuf:"bytes,2,rep,name=endpoints,proto3" json:"endpoints" bson:"endpoints"` // contains filtered or unexported fields }
服务功能列表
func (*EndpointSet) Descriptor
deprecated
func (*EndpointSet) Descriptor() ([]byte, []int)
Deprecated: Use EndpointSet.ProtoReflect.Descriptor instead.
func (*EndpointSet) GetEndpoints ¶
func (x *EndpointSet) GetEndpoints() []*Endpoint
func (*EndpointSet) GetService ¶
func (x *EndpointSet) GetService() string
func (*EndpointSet) ProtoMessage ¶
func (*EndpointSet) ProtoMessage()
func (*EndpointSet) ProtoReflect ¶
func (x *EndpointSet) ProtoReflect() protoreflect.Message
func (*EndpointSet) Reset ¶
func (x *EndpointSet) Reset()
func (*EndpointSet) String ¶
func (x *EndpointSet) String() string
type RPCClient ¶
type RPCClient interface { // 服务功能注册 RegistryEndpoint(ctx context.Context, in *EndpointSet, opts ...grpc.CallOption) (*RegistryResponse, error) }
RPCClient is the client API for RPC 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 NewRPCClient ¶
func NewRPCClient(cc grpc.ClientConnInterface) RPCClient
type RPCServer ¶
type RPCServer interface { // 服务功能注册 RegistryEndpoint(context.Context, *EndpointSet) (*RegistryResponse, error) // contains filtered or unexported methods }
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type RegistryResponse ¶
type RegistryResponse struct { // 注册返回 // @gotags: json:"message" bson:"message" Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message" bson:"message"` // contains filtered or unexported fields }
func NewRegistryResponse ¶
func NewRegistryResponse() *RegistryResponse
func (*RegistryResponse) Descriptor
deprecated
func (*RegistryResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegistryResponse.ProtoReflect.Descriptor instead.
func (*RegistryResponse) GetMessage ¶
func (x *RegistryResponse) GetMessage() string
func (*RegistryResponse) ProtoMessage ¶
func (*RegistryResponse) ProtoMessage()
func (*RegistryResponse) ProtoReflect ¶
func (x *RegistryResponse) ProtoReflect() protoreflect.Message
func (*RegistryResponse) Reset ¶
func (x *RegistryResponse) Reset()
func (*RegistryResponse) String ¶
func (x *RegistryResponse) String() string
type UnimplementedRPCServer ¶
type UnimplementedRPCServer struct { }
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) RegistryEndpoint ¶
func (UnimplementedRPCServer) RegistryEndpoint(context.Context, *EndpointSet) (*RegistryResponse, error)
type UnsafeRPCServer ¶
type UnsafeRPCServer interface {
// contains filtered or unexported methods
}
UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.