servers

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 19 Imported by: 5

Documentation

Overview

gen for home toolset

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllProvider

func GetAllProvider() []interface{}

func GetServer

func GetServer(leaders []interface{}) constraint.KernelServer

GetServer 提供统一命名规范的独立服务

Types

type Broadcast

type Broadcast struct {
	Connect *services.Redis

	Run bool
	// contains filtered or unexported fields
}

func (*Broadcast) Close added in v0.0.3

func (b *Broadcast) Close()

func (*Broadcast) Publish

func (b *Broadcast) Publish(topic string, m Msg)

func (*Broadcast) Subscribe

func (b *Broadcast) Subscribe(topic string)

Subscribe 订阅主题

type Crontab

type Crontab struct {
	Cron *cron.Cron
	// contains filtered or unexported fields
}

Crontab @Bean

func NewCrontab

func NewCrontab() *Crontab

func (*Crontab) AddFunc

func (crontab *Crontab) AddFunc(spec string, cmd func()) (cron.EntryID, error)

func (*Crontab) AddJob

func (crontab *Crontab) AddJob(spec string, cmd cron.Job) (cron.EntryID, error)

func (*Crontab) Exit

func (crontab *Crontab) Exit()

func (*Crontab) Init

func (crontab *Crontab) Init()

func (*Crontab) Run

func (crontab *Crontab) Run()

type Election

type Election struct {
	// 队列配置文件的所有配置
	*services.Config `inject:"config, election"`
	// 连接
	Connect *services.Redis
	// contains filtered or unexported fields
}

Election @Bean("election")

func NewElection

func NewElection() *Election

func (*Election) AppendRun

func (k *Election) AppendRun(fun func())

func (*Election) Exit

func (k *Election) Exit()

func (*Election) Init

func (k *Election) Init()

func (*Election) Run

func (k *Election) Run()

type Http

type Http struct {
	*providers.RouteProvider `inject:""`
	*services.HttpServer     `inject:""`
	*services.Config         `inject:"config, app.servers.http"`

	*gin.Engine
	Middleware      []gin.HandlerFunc
	MiddlewareGroup map[string][]gin.HandlerFunc

	Port string
	// contains filtered or unexported fields
}

Http 提供者 @Bean("http")

func NewHttp

func NewHttp() *Http

func (*Http) Boot

func (http *Http) Boot()

func (*Http) Exit

func (http *Http) Exit()

func (*Http) Init

func (http *Http) Init()

func (*Http) Run

func (http *Http) Run()

type Msg

type Msg struct {
	Route string `json:"route"`
	Data  string `json:"event"`
}

type Queue

type Queue struct {

	// 连接
	Connect *services.Redis
	// contains filtered or unexported fields
}

Queue @Bean("queue")

func NewQueue

func NewQueue() *Queue

func (*Queue) AddJob

func (q *Queue) AddJob(route string, handle constraint.Job)

func (*Queue) CloseBroadcast added in v0.0.3

func (q *Queue) CloseBroadcast()

func (*Queue) Exit

func (q *Queue) Exit()

func (*Queue) HasBroadcast

func (q *Queue) HasBroadcast() bool

func (*Queue) Init

func (q *Queue) Init()

func (*Queue) Listen

func (q *Queue) Listen(jobs []interface{})

func (*Queue) Publish

func (q *Queue) Publish(topic string, message interface{})

Publish 对message广播

func (*Queue) Push

func (q *Queue) Push(message interface{})

Push 投递队列

func (*Queue) Run

func (q *Queue) Run()

func (*Queue) StartBroadcast

func (q *Queue) StartBroadcast()

type Websocket

type Websocket struct {
}

Websocket @Bean

func NewWebsocket

func NewWebsocket() *Websocket

func (*Websocket) Exit

func (w *Websocket) Exit()

func (*Websocket) Init

func (w *Websocket) Init()

func (*Websocket) Run

func (w *Websocket) Run()

Jump to

Keyboard shortcuts

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