endpoint

package
v0.0.0-...-2c311f4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 12 Imported by: 0

README

服务接口管理

服务: 接口

抽取服务功能列表

Documentation

Index

Constants

View Source
const (
	AppName = "endpoints"
)

Variables

View Source
var File_apps_endpoint_pb_endpoint_proto protoreflect.FileDescriptor
View Source
var File_apps_endpoint_pb_rpc_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go9.devcloud.endpoint.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegistryEndpoint",
			Handler:    _RPC_RegistryEndpoint_Handler,
		},
		{
			MethodName: "QueryEnpoint",
			Handler:    _RPC_QueryEnpoint_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "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 CreateEndpointRequest

type CreateEndpointRequest struct {

	// 功能属于那个服务
	// @gotags: bson:"service_id" json:"service_id"
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id" bson:"service_id"`
	// 功能:  HTTP Method: Path  GET:/mpaas/api/v1/clusers
	// @gotags: bson:"method" json:"method"
	Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method" bson:"method"`
	// 功能的Path
	// @gotags: bson:"path" json:"path"
	Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path" bson:"path"`
	// 操作名称: 函数名称
	// @gotags: bson:"operation" json:"operation"
	Operation string `protobuf:"bytes,4,opt,name=operation,proto3" json:"operation" bson:"operation"`
	// 是否开启认证
	// @gotags: bson:"auth" json:"auth"
	Auth bool `protobuf:"varint,5,opt,name=auth,proto3" json:"auth" bson:"auth"`
	// 是否开启鉴权
	// @gotags: bson:"perm" json:"perm"
	Perm bool `protobuf:"varint,6,opt,name=perm,proto3" json:"perm" bson:"perm"`
	// contains filtered or unexported fields
}

func NewCreateEndpointRequest

func NewCreateEndpointRequest() *CreateEndpointRequest

func (*CreateEndpointRequest) Descriptor deprecated

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

Deprecated: Use CreateEndpointRequest.ProtoReflect.Descriptor instead.

func (*CreateEndpointRequest) GetAuth

func (x *CreateEndpointRequest) GetAuth() bool

func (*CreateEndpointRequest) GetMethod

func (x *CreateEndpointRequest) GetMethod() string

func (*CreateEndpointRequest) GetOperation

func (x *CreateEndpointRequest) GetOperation() string

func (*CreateEndpointRequest) GetPath

func (x *CreateEndpointRequest) GetPath() string

func (*CreateEndpointRequest) GetPerm

func (x *CreateEndpointRequest) GetPerm() bool

func (*CreateEndpointRequest) GetServiceId

func (x *CreateEndpointRequest) GetServiceId() string

func (*CreateEndpointRequest) ProtoMessage

func (*CreateEndpointRequest) ProtoMessage()

func (*CreateEndpointRequest) ProtoReflect

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

func (*CreateEndpointRequest) Reset

func (x *CreateEndpointRequest) Reset()

func (*CreateEndpointRequest) String

func (x *CreateEndpointRequest) String() string

func (*CreateEndpointRequest) UnitKey

func (r *CreateEndpointRequest) UnitKey() string

type Endpoint

type Endpoint struct {

	// 对象元数据
	// @gotags: bson:",inline" json:"meta"
	Meta *meta.Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta" bson:",inline"`
	// Endpiont相关信息
	// @gotags: bson:",inline" json:"spec"
	Spec *CreateEndpointRequest `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" bson:",inline"`
	// contains filtered or unexported fields
}

func New

func New(spec *CreateEndpointRequest) *Endpoint

func NewDefaultEndpoint

func NewDefaultEndpoint() *Endpoint

func (*Endpoint) Descriptor deprecated

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

Deprecated: Use Endpoint.ProtoReflect.Descriptor instead.

func (*Endpoint) GetMeta

func (x *Endpoint) GetMeta() *meta.Meta

func (*Endpoint) GetSpec

func (x *Endpoint) GetSpec() *CreateEndpointRequest

func (*Endpoint) ProtoMessage

func (*Endpoint) ProtoMessage()

func (*Endpoint) ProtoReflect

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

func (*Endpoint) Reset

func (x *Endpoint) Reset()

func (*Endpoint) String

func (x *Endpoint) String() string

type EndpointSet

type EndpointSet struct {

	// 用户总数量
	// @gotags: json:"total"
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
	// 分页的用户列表
	// @gotags: json:"items"
	Items []*Endpoint `protobuf:"bytes,2,rep,name=items,proto3" json:"items"`
	// contains filtered or unexported fields
}

func NewEndpiontSet

func NewEndpiontSet() *EndpointSet

func (*EndpointSet) Add

func (s *EndpointSet) Add(item *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) GetTotal

func (x *EndpointSet) GetTotal() int64

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 QueryEnpointRequest

type QueryEnpointRequest struct {

	// 分页参数
	Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page,omitempty"`
	// contains filtered or unexported fields
}

func NewQueryEnpointRequest

func NewQueryEnpointRequest() *QueryEnpointRequest

func (*QueryEnpointRequest) Descriptor deprecated

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

Deprecated: Use QueryEnpointRequest.ProtoReflect.Descriptor instead.

func (*QueryEnpointRequest) GetPage

func (x *QueryEnpointRequest) GetPage() *request.PageRequest

func (*QueryEnpointRequest) ProtoMessage

func (*QueryEnpointRequest) ProtoMessage()

func (*QueryEnpointRequest) ProtoReflect

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

func (*QueryEnpointRequest) Reset

func (x *QueryEnpointRequest) Reset()

func (*QueryEnpointRequest) String

func (x *QueryEnpointRequest) String() string

type RPCClient

type RPCClient interface {
	// 注册服务的功能列表
	// Deprecated: v1.2版本后不再使用,请升级到XXX(), Example:
	RegistryEndpoint(ctx context.Context, in *RegistryRequest, opts ...grpc.CallOption) (*EndpointSet, error)
	// 查询功能列表
	QueryEnpoint(ctx context.Context, in *QueryEnpointRequest, 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 {
	// 注册服务的功能列表
	// Deprecated: v1.2版本后不再使用,请升级到XXX(), Example:
	RegistryEndpoint(context.Context, *RegistryRequest) (*EndpointSet, error)
	// 查询功能列表
	QueryEnpoint(context.Context, *QueryEnpointRequest) (*EndpointSet, error)
	// contains filtered or unexported methods
}

RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility

type RegistryRequest

type RegistryRequest struct {

	// 分页的用户列表
	// @gotags: json:"items"
	Items []*CreateEndpointRequest `protobuf:"bytes,2,rep,name=items,proto3" json:"items"`
	// contains filtered or unexported fields
}

func NewRegistryRequest

func NewRegistryRequest() *RegistryRequest

func (*RegistryRequest) Add

func (s *RegistryRequest) Add(item *CreateEndpointRequest)

func (*RegistryRequest) Descriptor deprecated

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

Deprecated: Use RegistryRequest.ProtoReflect.Descriptor instead.

func (*RegistryRequest) GetItems

func (x *RegistryRequest) GetItems() []*CreateEndpointRequest

func (*RegistryRequest) ProtoMessage

func (*RegistryRequest) ProtoMessage()

func (*RegistryRequest) ProtoReflect

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

func (*RegistryRequest) Reset

func (x *RegistryRequest) Reset()

func (*RegistryRequest) String

func (x *RegistryRequest) String() string

type Service

type Service interface {
	RPCServer
}

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedRPCServer) QueryEnpoint

func (UnimplementedRPCServer) RegistryEndpoint

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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