Documentation
¶
Index ¶
- Constants
- Variables
- type CommandEventCallback
- type Config
- type EventHandler
- type Instant
- func (i *Instant) AddContext(context botc.BotContext) bool
- func (i *Instant) CloseDatabase() error
- func (i *Instant) Command(format string) *command.FormatBuilder
- func (i *Instant) CommandEmit(cmd *command.Context)
- func (i *Instant) Database() *sql.DB
- func (i *Instant) DatabaseExist() bool
- func (i *Instant) EventEmit(eventName string, args ...interface{}) error
- func (i *Instant) EventRegister(eventName string)
- func (i *Instant) EventUnregister(eventName string)
- func (i *Instant) GetContext(protocol string) botc.BotContext
- func (i *Instant) GetLogger() logger.Inst
- func (i *Instant) GetOwner(id string) (owner string, ok bool)
- func (i *Instant) GetResource(resourceID string) (Resource, error)
- func (i *Instant) GetResourceData(resourceID string) ([]byte, error)
- func (i *Instant) MessageEmit(msg botc.MessageContext) error
- func (i *Instant) Middleware(callback MiddlewareCallback, prepare ...bool) func()
- func (i *Instant) On(event EventHandler) (func(), error)
- func (i *Instant) OpenDatabase(driverName string, dataSourceName string) error
- func (i *Instant) Remove(service Service) error
- func (i *Instant) RemoveContext(protocol string) bool
- func (i *Instant) ResourceExists(resourceID string) bool
- func (i *Instant) Run() error
- func (i *Instant) SaveRemoteResource(resourceURL string) (*Resource, error)
- func (i *Instant) SaveResourceData(data []byte, ext string) (string, error)
- func (i *Instant) Use(service Service)
- func (i *Instant) UseLogger(logger logger.Inst)
- type MessageEventCallback
- type Middleware
- type MiddlewareCallback
- type MiddlewareSystem
- type Resource
- type Service
Constants ¶
View Source
const (
ConfigPath = "conf/config.json"
)
Variables ¶
View Source
var DefaultConfig []byte
Functions ¶
This section is empty.
Types ¶
type CommandEventCallback ¶
type EventHandler ¶
func CommandEvent ¶
func CommandEvent(callback CommandEventCallback) EventHandler
func MessageEvent ¶
func MessageEvent(callback MessageEventCallback) EventHandler
type Instant ¶
type Instant struct {
// contains filtered or unexported fields
}
func (*Instant) AddContext ¶
func (i *Instant) AddContext(context botc.BotContext) bool
func (*Instant) CloseDatabase ¶
func (*Instant) CommandEmit ¶
func (*Instant) DatabaseExist ¶
func (*Instant) EventRegister ¶
func (*Instant) EventUnregister ¶
func (*Instant) GetContext ¶
func (i *Instant) GetContext(protocol string) botc.BotContext
func (*Instant) GetResource ¶
GetResource 根据资源ID获取资源信息
func (*Instant) GetResourceData ¶
func (*Instant) MessageEmit ¶
func (i *Instant) MessageEmit(msg botc.MessageContext) error
func (*Instant) Middleware ¶
func (i *Instant) Middleware(callback MiddlewareCallback, prepare ...bool) func()
func (*Instant) On ¶
func (i *Instant) On(event EventHandler) (func(), error)
func (*Instant) OpenDatabase ¶
func (*Instant) RemoveContext ¶
func (*Instant) ResourceExists ¶
func (*Instant) SaveRemoteResource ¶
SaveRemoteResource 保存资源文件,并更新资源索引
func (*Instant) SaveResourceData ¶
type MessageEventCallback ¶
type MessageEventCallback func(ctx botc.MessageContext)
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
type MiddlewareCallback ¶
type MiddlewareCallback func(msg botc.MessageContext, next func(...MiddlewareCallback) error) error
type MiddlewareSystem ¶
type MiddlewareSystem struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.