core

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.3.4

type Client struct {
	// contains filtered or unexported fields
}

Client gRPC客户端封装

func NewClient added in v0.3.4

func NewClient(connections map[string]*grpc.ClientConn) *Client

func (*Client) Connection added in v0.3.4

func (c *Client) Connection(name string) *grpc.ClientConn

type Gateway added in v0.4.3

type Gateway struct {
	// contains filtered or unexported fields
}

func NewGateway added in v0.4.3

func NewGateway(logger log.Logger) *Gateway

func (*Gateway) Status added in v0.4.3

func (g *Gateway) Status(ctx context.Context, code int)

type Handler added in v0.3.4

type Handler func(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

Handler 端点注册方法

type Handlers added in v0.3.4

type Handlers []Handler

Handlers 端点注册接口组

type Register added in v0.3.4

type Register interface {
	// Grpc gRPC服务
	Grpc(server *grpc.Server)

	// Gateway 网关服务
	Gateway(mux *runtime.ServeMux, opts *[]grpc.DialOption) (ctx context.Context, handlers Handlers)
}

type Server added in v0.3.4

type Server struct {
	// contains filtered or unexported fields
}

Server gRPC服务器封装

func NewServer added in v0.3.4

func NewServer(
	rpc *grpc.Server,
	mux *http.ServeMux,
	server *config.Server, gateway *config.Gateway,
	logger log.Logger,
) *Server

func (*Server) Serve added in v0.3.4

func (s *Server) Serve(register Register) (err error)

func (*Server) Stop added in v0.3.4

func (s *Server) Stop(ctx context.Context) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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