Documentation
¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CORSMiddleware() gin.HandlerFunc
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type ConsulPlugin
- func (c *ConsulPlugin) Close() error
- func (p *ConsulPlugin) MergeFrom(a interface{}) error
- func (p *ConsulPlugin) OnFinished(ctx context.Context, sv pool.Instance)
- func (p *ConsulPlugin) OnSpawned(ctx context.Context, sv pool.Instance)
- func (c *ConsulPlugin) OnStarted(ctx context.Context, sv pool.Instance)
- func (c *ConsulPlugin) OnStopped(ctx context.Context, sv pool.Instance, err error)
- func (p *ConsulPlugin) Prepare(ctx context.Context, pl *pool.Pool) error
- type Critical
- func (a *Critical) Close() error
- func (a *Critical) MergeFrom(other interface{}) error
- func (p *Critical) OnFinished(ctx context.Context, sv pool.Instance)
- func (p *Critical) OnSpawned(ctx context.Context, sv pool.Instance)
- func (p *Critical) OnStarted(ctx context.Context, sv pool.Instance)
- func (p *Critical) OnStopped(ctx context.Context, sv pool.Instance, err error)
- func (a *Critical) Prepare(ctx context.Context, pl *pool.Pool) error
- type Email
- func (a *Email) Close() error
- func (a *Email) MergeFrom(other interface{}) error
- func (p *Email) OnFinished(ctx context.Context, sv pool.Instance)
- func (c *Email) OnSpawned(ctx context.Context, sv pool.Instance)
- func (c *Email) OnStarted(ctx context.Context, sv pool.Instance)
- func (c *Email) OnStopped(ctx context.Context, sv pool.Instance, err error)
- func (c *Email) Prepare(ctx context.Context, pl *pool.Pool) error
- type Http
- func (a *Http) Close() error
- func (a *Http) MergeFrom(other interface{}) error
- func (p *Http) OnFinished(ctx context.Context, sv pool.Instance)
- func (p *Http) OnSpawned(ctx context.Context, sv pool.Instance)
- func (c *Http) OnStarted(ctx context.Context, sv pool.Instance)
- func (c *Http) OnStopped(ctx context.Context, sv pool.Instance, err error)
- func (c *Http) Prepare(ctx context.Context, pl *pool.Pool) error
- type PluginConfigNG
- type RestPlugin
- func (a *RestPlugin) Close() error
- func (p *RestPlugin) MergeFrom(o interface{}) error
- func (p *RestPlugin) OnFinished(ctx context.Context, sv pool.Instance)
- func (p *RestPlugin) OnSpawned(ctx context.Context, sv pool.Instance)
- func (p *RestPlugin) OnStarted(ctx context.Context, sv pool.Instance)
- func (p *RestPlugin) OnStopped(ctx context.Context, sv pool.Instance, err error)
- func (p *RestPlugin) Prepare(ctx context.Context, pl *pool.Pool) error
- type Telegram
- func (a *Telegram) Close() error
- func (a *Telegram) MergeFrom(other interface{}) error
- func (p *Telegram) OnFinished(ctx context.Context, sv pool.Instance)
- func (p *Telegram) OnSpawned(ctx context.Context, sv pool.Instance)
- func (c *Telegram) OnStarted(ctx context.Context, sv pool.Instance)
- func (c *Telegram) OnStopped(ctx context.Context, sv pool.Instance, err error)
- func (c *Telegram) Prepare(ctx context.Context, pl *pool.Pool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶ added in v0.1.7
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶ added in v0.1.7
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.1.7
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.1.7
func AssetNames() []string
AssetNames returns the names of the assets.
func CORSMiddleware ¶ added in v0.1.9
func CORSMiddleware() gin.HandlerFunc
func MustAsset ¶ added in v0.1.7
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶ added in v0.1.7
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v0.1.7
RestoreAssets restores an asset under the given directory recursively
Types ¶
type ConsulPlugin ¶ added in v0.1.6
type ConsulPlugin struct { URL string `yaml:"url"` TTL time.Duration `yaml:"ttl"` AutoDeregistrationTimeout time.Duration `yaml:"timeout"` Dynamic []string `yaml:"register,omitempty"` Permanent []string `yaml:"permanent,omitempty"` Log *log.Logger `yaml:"-"` Client *api.Client `yaml:"-"` // contains filtered or unexported fields }
func DefaultConsul ¶ added in v0.1.6
func DefaultConsul() ConsulPlugin
func (*ConsulPlugin) Close ¶ added in v0.1.6
func (c *ConsulPlugin) Close() error
func (*ConsulPlugin) MergeFrom ¶ added in v0.1.6
func (p *ConsulPlugin) MergeFrom(a interface{}) error
func (*ConsulPlugin) OnFinished ¶ added in v0.1.6
func (p *ConsulPlugin) OnFinished(ctx context.Context, sv pool.Instance)
func (*ConsulPlugin) OnSpawned ¶ added in v0.1.6
func (p *ConsulPlugin) OnSpawned(ctx context.Context, sv pool.Instance)
func (*ConsulPlugin) OnStarted ¶ added in v0.1.6
func (c *ConsulPlugin) OnStarted(ctx context.Context, sv pool.Instance)
type Critical ¶ added in v0.1.6
type Critical struct {
Labels []string `mapstructure:"<ITEMS>"`
}
func (*Critical) OnFinished ¶ added in v0.1.6
type Email ¶
type Email struct { Smtp string `yaml:"smtp"` From string `yaml:"from"` Password string `yaml:"password"` To []string `yaml:"to"` Services []string `yaml:"services"` // contains filtered or unexported fields }
func (*Email) OnFinished ¶ added in v0.1.6
type Http ¶ added in v0.1.4
type Http struct { URL string `yaml:"url" mapstructure:"url"` // template URL string Method string `yaml:"method"` // default POST Headers map[string]string `yaml:"headers" mapstructure:"headers"` // additional header (non-template) Services []string `yaml:"services"` Timeout time.Duration `yaml:"timeout"` // contains filtered or unexported fields }
func (*Http) OnFinished ¶ added in v0.1.6
type PluginConfigNG ¶ added in v0.1.6
type PluginConfigNG interface { // Must handle events pool.EventHandler // Closable io.Closer // Merge change from other instance. Other is always has same type as original MergeFrom(other interface{}) error // Prepare internal state Prepare(ctx context.Context, pl *pool.Pool) error }
Base interface for any future plugins
func BuildPlugin ¶
func BuildPlugin(name string, file string) (PluginConfigNG, bool)
Build but not fill one config
type RestPlugin ¶ added in v0.1.6
type RestPlugin struct { Listen string `yaml:"listen"` CORS bool `yaml:"cors"` // contains filtered or unexported fields }
func (*RestPlugin) Close ¶ added in v0.1.6
func (a *RestPlugin) Close() error
func (*RestPlugin) MergeFrom ¶ added in v0.1.6
func (p *RestPlugin) MergeFrom(o interface{}) error
func (*RestPlugin) OnFinished ¶ added in v0.1.6
func (p *RestPlugin) OnFinished(ctx context.Context, sv pool.Instance)
func (*RestPlugin) OnSpawned ¶ added in v0.1.6
func (p *RestPlugin) OnSpawned(ctx context.Context, sv pool.Instance)
func (*RestPlugin) OnStarted ¶ added in v0.1.6
func (p *RestPlugin) OnStarted(ctx context.Context, sv pool.Instance)
type Telegram ¶
type Telegram struct { Token string `yaml:"token"` Recipients []int64 `yaml:"recipients"` Services []string `yaml:"services"` // contains filtered or unexported fields }