updater

package
v0.0.0-...-de9bd37 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(bot *methods.BotExt, update *types.Update)

Handler 处理函数

type Pool

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

Pool 工作队列

func NewPool

func NewPool(numWorkers int) *Pool

NewPool 创建工作队列

func (*Pool) Async

func (pool *Pool) Async(callback func())

Async 添加异步任务

type Queue

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

Queue 消息队列

func NewQueue

func NewQueue(numWorkers uint32) *Queue

NewQueue 创建消息队列

func (*Queue) Put

func (queue *Queue) Put(f future)

Put 添加更新

type Updater

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

Updater 更新器

func NewUpdater

func NewUpdater(domain string, apiwebsite string) (*Updater, error)

NewUpdater 创建更新器

func (*Updater) AddHandler

func (updater *Updater) AddHandler(token string, handler Handler) (*methods.BotExt, error)

AddHandler 添加处理模块

func (*Updater) GetRouter

func (updater *Updater) GetRouter() http.Handler

GetRouter 获取路由器

func (*Updater) ListenAndServe

func (updater *Updater) ListenAndServe(addr string) error

ListenAndServe 监听并服务

func (*Updater) RemoveHandler

func (updater *Updater) RemoveHandler(token string)

RemoveHandler 移除处理模块

Jump to

Keyboard shortcuts

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