xmqc

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeregisterServer

func DeregisterServer(name string)

Deregister 清理配置适配器

func GetService

func GetService(queue string) string

func RegisterServer

func RegisterServer(resolver ServerResolver)

Register 注册配置文件适配器

Types

type Config

type Config struct {
	Addr   string        `json:"addr"`
	Status engine.Status `json:"status"`
	Proto  string        `json:"proto"`
}

type Server

type Server interface {
	GetProto() string
	GetAddr() string
	Serve(ctx context.Context) (err error)
	Stop(ctx context.Context) error
}

func NewServer

func NewServer(proto string,
	router *engine.RouterGroup,
	cfg config.Config,
	opts ...engine.Option) (Server, error)

NewServer 根据适配器名称及参数返回配置处理器

type ServerResolver added in v0.7.1

type ServerResolver interface {
	Name() string
	Resolve(name string,
		router *engine.RouterGroup,
		cfg config.Config,
		opts ...engine.Option) (Server, error)
}

ServerResover 定义配置文件转换方法

type Task

type Task struct {
	Queue             string            `json:"queue"`
	Service           string            `json:"service,omitempty"`
	Disable           bool              `json:"disable"`
	Concurrency       int               `json:"concurrency,omitempty"`
	BufferSize        int               `json:"buffersize,omitempty"`
	VisibilityTimeout int               `json:"visibility_timeout"`
	Meta              metadata.Metadata `json:"meta,omitempty"`
}

func (Task) GetBufferSize added in v0.5.6

func (s Task) GetBufferSize() int

func (Task) GetConcurrency

func (t Task) GetConcurrency() int

func (Task) GetMeta added in v0.5.7

func (s Task) GetMeta() metadata.Metadata

func (Task) GetQueue

func (t Task) GetQueue() string

func (*Task) GetService

func (t *Task) GetService() string

func (Task) GetVisibilityTimeout added in v0.5.6

func (s Task) GetVisibilityTimeout() int

type TaskList

type TaskList []*Task

Jump to

Keyboard shortcuts

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