core

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 21 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 Handler added in v0.3.4

type Handler func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) 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(server *grpc.Server, mux *http.ServeMux, config *config.Server, logger simaqian.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()

Jump to

Keyboard shortcuts

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