Documentation ¶
Index ¶
- Constants
- Variables
- func GetValueFromMeta(meta map[string]any, key string) string
- func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
- type Endpoint
- type EndpointSet
- func (s *EndpointSet) Add(items ...*Endpoint)
- func (*EndpointSet) Descriptor() ([]byte, []int)deprecated
- func (x *EndpointSet) GetItems() []*Endpoint
- func (*EndpointSet) ProtoMessage()
- func (x *EndpointSet) ProtoReflect() protoreflect.Message
- func (x *EndpointSet) Reset()
- func (x *EndpointSet) String() string
- func (s *EndpointSet) ToMongoDocs() (docs []any)
- type EndpointSpec
- func (*EndpointSpec) Descriptor() ([]byte, []int)deprecated
- func (s *EndpointSpec) GenId() string
- func (x *EndpointSpec) GetAction() string
- func (x *EndpointSpec) GetDescription() string
- func (x *EndpointSpec) GetPath() string
- func (x *EndpointSpec) GetResource() string
- func (x *EndpointSpec) GetService() string
- func (*EndpointSpec) ProtoMessage()
- func (x *EndpointSpec) ProtoReflect() protoreflect.Message
- func (x *EndpointSpec) Reset()
- func (x *EndpointSpec) String() string
- type EndpointSpecSet
- func (s *EndpointSpecSet) Add(items ...*EndpointSpec)
- func (*EndpointSpecSet) Descriptor() ([]byte, []int)deprecated
- func (x *EndpointSpecSet) GetItems() []*EndpointSpec
- func (*EndpointSpecSet) ProtoMessage()
- func (x *EndpointSpecSet) ProtoReflect() protoreflect.Message
- func (x *EndpointSpecSet) Reset()
- func (s *EndpointSpecSet) Service() (svcs []string)
- func (x *EndpointSpecSet) String() string
- type RpcClient
- type RpcServer
- type Service
- type UnimplementedRpcServer
- type UnsafeRpcServer
Constants ¶
const AppName = "endpoints"
const (
Rpc_RegistryEndpoints_FullMethodName = "/go11.devcloud_mini.endpoint.Rpc/RegistryEndpoints"
)
Variables ¶
var File_mcenter_apps_endpoint_pb_model_proto protoreflect.FileDescriptor
var File_mcenter_apps_endpoint_pb_rpc_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go11.devcloud_mini.endpoint.Rpc", HandlerType: (*RpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RegistryEndpoints", Handler: _Rpc_RegistryEndpoints_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "mcenter/apps/endpoint/pb/rpc.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:"meta" bson:",inline" Meta *resource.Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta" bson:",inline"` // Endpoint定义 // @gotags: json:"spec" bson:",inline" Spec *EndpointSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" bson:",inline"` // contains filtered or unexported fields }
func NewEndpoint ¶
func NewEndpoint(spec *EndpointSpec) *Endpoint
func (*Endpoint) Descriptor
deprecated
func (*Endpoint) GetSpec ¶
func (x *Endpoint) GetSpec() *EndpointSpec
func (*Endpoint) ProtoMessage ¶
func (*Endpoint) ProtoMessage()
func (*Endpoint) ProtoReflect ¶
func (x *Endpoint) ProtoReflect() protoreflect.Message
type EndpointSet ¶
type EndpointSet struct { // 服务功能列表 // @gotags: json:"items" bson:"items" Items []*Endpoint `protobuf:"bytes,1,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func NewEndpointSet ¶
func NewEndpointSet(specs *EndpointSpecSet) *EndpointSet
func (*EndpointSet) Add ¶
func (s *EndpointSet) Add(items ...*Endpoint)
func (*EndpointSet) Descriptor
deprecated
func (*EndpointSet) Descriptor() ([]byte, []int)
Deprecated: Use EndpointSet.ProtoReflect.Descriptor instead.
func (*EndpointSet) GetItems ¶
func (x *EndpointSet) GetItems() []*Endpoint
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
func (*EndpointSet) ToMongoDocs ¶
func (s *EndpointSet) ToMongoDocs() (docs []any)
type EndpointSpec ¶
type EndpointSpec struct { // 服务名称 // @gotags: json:"service" bson:"service" Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service" bson:"service"` // 服务资源名称 // @gotags: json:"resource" bson:"resource" Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource" bson:"resource"` // 服务资源操作 // @gotags: json:"action" bson:"action" Action string `protobuf:"bytes,5,opt,name=action,proto3" json:"action" bson:"action"` // 功能的路径: post.url // @gotags: json:"path" bson:"path" Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path" bson:"path"` // 功能描述 // @gotags: json:"description" bson:"description" Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description" bson:"description"` // contains filtered or unexported fields }
func NewEndpointSpec ¶
func NewEndpointSpec(service, path string) *EndpointSpec
func (*EndpointSpec) Descriptor
deprecated
func (*EndpointSpec) Descriptor() ([]byte, []int)
Deprecated: Use EndpointSpec.ProtoReflect.Descriptor instead.
func (*EndpointSpec) GenId ¶
func (s *EndpointSpec) GenId() string
Role需要应用Endpoint的Id, Endpoint的Id不能随机生成
func (*EndpointSpec) GetAction ¶
func (x *EndpointSpec) GetAction() string
func (*EndpointSpec) GetDescription ¶
func (x *EndpointSpec) GetDescription() string
func (*EndpointSpec) GetPath ¶
func (x *EndpointSpec) GetPath() string
func (*EndpointSpec) GetResource ¶
func (x *EndpointSpec) GetResource() string
func (*EndpointSpec) GetService ¶
func (x *EndpointSpec) GetService() string
func (*EndpointSpec) ProtoMessage ¶
func (*EndpointSpec) ProtoMessage()
func (*EndpointSpec) ProtoReflect ¶
func (x *EndpointSpec) ProtoReflect() protoreflect.Message
func (*EndpointSpec) Reset ¶
func (x *EndpointSpec) Reset()
func (*EndpointSpec) String ¶
func (x *EndpointSpec) String() string
type EndpointSpecSet ¶
type EndpointSpecSet struct { // 服务功能列表 // @gotags: json:"items" bson:"items" Items []*EndpointSpec `protobuf:"bytes,1,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func NewEndpointSpecSet ¶
func NewEndpointSpecSet() *EndpointSpecSet
func (*EndpointSpecSet) Add ¶
func (s *EndpointSpecSet) Add(items ...*EndpointSpec)
func (*EndpointSpecSet) Descriptor
deprecated
func (*EndpointSpecSet) Descriptor() ([]byte, []int)
Deprecated: Use EndpointSpecSet.ProtoReflect.Descriptor instead.
func (*EndpointSpecSet) GetItems ¶
func (x *EndpointSpecSet) GetItems() []*EndpointSpec
func (*EndpointSpecSet) ProtoMessage ¶
func (*EndpointSpecSet) ProtoMessage()
func (*EndpointSpecSet) ProtoReflect ¶
func (x *EndpointSpecSet) ProtoReflect() protoreflect.Message
func (*EndpointSpecSet) Reset ¶
func (x *EndpointSpecSet) Reset()
func (*EndpointSpecSet) Service ¶
func (s *EndpointSpecSet) Service() (svcs []string)
func (*EndpointSpecSet) String ¶
func (x *EndpointSpecSet) String() string
type RpcClient ¶
type RpcClient interface { // 功能注册(全量注册) RegistryEndpoints(ctx context.Context, in *EndpointSpecSet, opts ...grpc.CallOption) (*EndpointSet, 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 { // 功能注册(全量注册) RegistryEndpoints(context.Context, *EndpointSpecSet) (*EndpointSet, error) // contains filtered or unexported methods }
RpcServer is the server API for Rpc service. All implementations must embed UnimplementedRpcServer for forward compatibility
type UnimplementedRpcServer ¶
type UnimplementedRpcServer struct { }
UnimplementedRpcServer must be embedded to have forward compatible implementations.
func (UnimplementedRpcServer) RegistryEndpoints ¶
func (UnimplementedRpcServer) RegistryEndpoints(context.Context, *EndpointSpecSet) (*EndpointSet, 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.