config

package
v0.0.0-...-8468317 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global = &Engine{}

Functions

This section is empty.

Types

type Config

type Config map[string]any

func Struct2Config

func Struct2Config(s any) (config Config)

func (Config) Assign

func (c Config) Assign(source Config)

func (Config) Get

func (c Config) Get(key string) any

func (Config) GetChild

func (c Config) GetChild(key string) Config

func (Config) Has

func (c Config) Has(key string) (ok bool)

func (Config) HasChild

func (c Config) HasChild(key string) (ok bool)

func (*Config) Set

func (c *Config) Set(key string, value any)

func (Config) Unmarshal

func (c Config) Unmarshal(s any)

type Engine

type Engine struct{}

func (*Engine) OnEvent

func (cfg *Engine) OnEvent(msg *robot.Message)

func (*Engine) OnRegister

func (cfg *Engine) OnRegister()

type Plugin

type Plugin interface {
	// OnRegister 注册后发生
	OnRegister()
	// OnEvent 产生event发生
	OnEvent(msg *robot.Message)
}

Jump to

Keyboard shortcuts

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