mqc

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Port = 1988
)
View Source
const Type string = "mqc"

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option 参数设置类型

func Log added in v0.1.15

func Log(opts ...log.ServerOption) Option

Log 设置日志配置

func WithConfig

func WithConfig(config config.Config) Option

WithStartedHook 设置启动回调函数

func WithDecodeRequestFunc added in v0.5.1

func WithDecodeRequestFunc(decReq engine.DecodeRequestFunc) Option

WithDecodeRequestFunc 解析入参

func WithEncodeErrorFunc added in v0.5.1

func WithEncodeErrorFunc(encErr engine.EncodeErrorFunc) Option

WithEncodeErrorFunc 编码错误

func WithEncodeResponseFunc added in v0.5.1

func WithEncodeResponseFunc(encResp engine.EncodeResponseFunc) Option

WithEncodeResponseFunc 编码响应

func WithServiceName added in v0.1.8

func WithServiceName(serviceName string) Option

WithServiceName 设置服务名称

type Server

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

func New

func New(name string, opts ...Option) *Server

New 实例化

func (*Server) Attempt

func (e *Server) Attempt() bool

Attempt 判断是否可以启动

func (*Server) Config

func (e *Server) Config(cfg config.Config)

func (*Server) Endpoint added in v0.1.8

func (e *Server) Endpoint() *url.URL

func (*Server) Group

func (e *Server) Group(group string, middlewares ...middleware.Middleware) *engine.RouterGroup

func (*Server) Handle

func (e *Server) Handle(queue string, obj interface{})

func (*Server) Name

func (e *Server) Name() string

func (*Server) Options

func (e *Server) Options(opts ...Option)

Options 设置参数

func (*Server) RouterPathList added in v0.5.11

func (s *Server) RouterPathList() []string

获取树形的路径列表

func (*Server) ServiceName added in v0.1.8

func (s *Server) ServiceName() string

ServiceName 服务名称

func (*Server) Start

func (e *Server) Start(ctx context.Context) (err error)

Start 开始

func (*Server) Stop

func (e *Server) Stop(ctx context.Context) error

Shutdown 停止

func (*Server) Type

func (e *Server) Type() string

func (*Server) Use

func (e *Server) Use(middlewares ...middleware.Middleware)

Jump to

Keyboard shortcuts

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