endpoint

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "endpoint"
)
View Source
const (
	RPC_RegistryEndpoint_FullMethodName = "/keyauth_gp.endpoint.RPC/RegistryEndpoint"
)

Variables

View Source
var File_apps_endpoint_pb_endpoint_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyauth_gp.endpoint.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegistryEndpoint",
			Handler:    _RPC_RegistryEndpoint_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/endpoint/pb/endpoint.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) Descriptor() ([]byte, []int)

Deprecated: Use Endpoint.ProtoReflect.Descriptor instead.

func (*Endpoint) GetAction

func (x *Endpoint) GetAction() string

func (*Endpoint) GetLabels

func (x *Endpoint) GetLabels() map[string]string

func (*Endpoint) GetMethod

func (x *Endpoint) GetMethod() string

func (*Endpoint) GetPath

func (x *Endpoint) GetPath() string

func (*Endpoint) GetResource

func (x *Endpoint) GetResource() string

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:"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 NewRegistryEndpointRequest added in v0.0.7

func NewRegistryEndpointRequest() *EndpointSet

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

func (*EndpointSet) ToDocs

func (s *EndpointSet) ToDocs() (docs []interface{})

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

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