Documentation ¶
Index ¶
- func AuthorizationMiddleware() middleware.Middleware
- func DefaultClientMiddlewares(logger log.Logger) []middleware.Middleware
- func NewHttpClientConn(server *def.Server, logger log.Logger) (*http.Client, error)
- func RegisterGRPCClient(nameAndType []string, repo config.ConfigureWatcherRepo, logger log.Logger) (grpc.ClientConnInterface, error)
- func RegisterHTTPClient(nameAndType []string, repo config.ConfigureWatcherRepo, logger log.Logger) (*http.Client, error)
- type GrpcClientConn
- type RegisterGRPCClientFactoryType
- type RegisterHTTPClientFactoryType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizationMiddleware ¶
func AuthorizationMiddleware() middleware.Middleware
func DefaultClientMiddlewares ¶
func DefaultClientMiddlewares(logger log.Logger) []middleware.Middleware
func NewHttpClientConn ¶
func RegisterGRPCClient ¶
func RegisterGRPCClient(nameAndType []string, repo config.ConfigureWatcherRepo, logger log.Logger) (grpc.ClientConnInterface, error)
func RegisterHTTPClient ¶
Types ¶
type GrpcClientConn ¶
type GrpcClientConn struct { *grpc.ClientConn // 基于 grpc ClientConn 进行简易封装 // contains filtered or unexported fields }
GrpcClientConn 是对 grpc.ClientConn 的简易封装,用于后续实现热更新等能力 TODO: 当前使用网关来实现该功能,后续根据需要再支持多节点负载均衡等能力
func NewGrpcClientConn ¶
func NewGrpcClientConn(server *def.Server, logger log.Logger, options ...kgrpc.ClientOption) (*GrpcClientConn, error)
func (*GrpcClientConn) Invoke ¶
func (c *GrpcClientConn) Invoke(ctx context.Context, method string, args, reply any, opts ...grpc.CallOption) error
func (*GrpcClientConn) NewStream ¶
func (c *GrpcClientConn) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
type RegisterGRPCClientFactoryType ¶
type RegisterGRPCClientFactoryType = func(conf *def.Server) (grpc.ClientConnInterface, error)
Click to show internal directories.
Click to hide internal directories.