plugin

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2014 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activate

func Activate(name string)

func Deactivate

func Deactivate(name string)

func GetPlugins

func GetPlugins() map[string]PluginInterface

func Handler

func Handler(name string, h GoInk.Handler, inter bool)

func Handlers

func Handlers() (map[string]map[string]GoInk.Handler, map[string]pluginRoute)

func Init

func Init()

func Route added in v0.2.0

func Route(name string, method string, pattern string, handler GoInk.Handler)

func Update added in v0.2.0

func Update(app *GoInk.App)

Types

type EmailPlugin

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

Email plugin instance, contains activation status, handler status, settings and templates.

func (*EmailPlugin) Activate

func (p *EmailPlugin) Activate()

Activate activates email plugin. It will change activate status to on. If the handlers are not registered, it will add handlers to router table.

func (*EmailPlugin) Deactivate

func (p *EmailPlugin) Deactivate()

Deactivate closes this email plugin.

func (*EmailPlugin) Desc

func (p *EmailPlugin) Desc() string

Desc returns email plugin descripition.

func (*EmailPlugin) Form

func (p *EmailPlugin) Form() string

Form returns the form template string for email plugin.

func (*EmailPlugin) HasSetting

func (p *EmailPlugin) HasSetting() bool

HasSetting returns bool of setting form existing.

func (*EmailPlugin) IsActive

func (p *EmailPlugin) IsActive() bool

IsActive returns plugin activation status.

func (*EmailPlugin) Key

func (p *EmailPlugin) Key() string

Key returns email plugin unique key.

func (*EmailPlugin) Name

func (p *EmailPlugin) Name() string

Name returns email plugin name

func (*EmailPlugin) SetSetting

func (p *EmailPlugin) SetSetting(settings map[string]string)

SetSettings saves plugin settings to json.

func (*EmailPlugin) ToStorage

func (p *EmailPlugin) ToStorage() map[string]interface{}

ToStorage creates plugin storage map for plugin list json.

func (*EmailPlugin) Version

func (p *EmailPlugin) Version() string

Version returns plugin version string.

type HelloPlugin

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

func (*HelloPlugin) Activate

func (p *HelloPlugin) Activate()

func (*HelloPlugin) Deactivate

func (p *HelloPlugin) Deactivate()

func (*HelloPlugin) Desc

func (p *HelloPlugin) Desc() string

func (*HelloPlugin) Form

func (p *HelloPlugin) Form() string

func (*HelloPlugin) HasSetting

func (p *HelloPlugin) HasSetting() bool

func (*HelloPlugin) IsActive

func (p *HelloPlugin) IsActive() bool

func (*HelloPlugin) Key

func (p *HelloPlugin) Key() string

func (*HelloPlugin) Name

func (p *HelloPlugin) Name() string

func (*HelloPlugin) SetSetting

func (p *HelloPlugin) SetSetting(settings map[string]string)

func (*HelloPlugin) ToStorage

func (p *HelloPlugin) ToStorage() map[string]interface{}

func (*HelloPlugin) Version

func (p *HelloPlugin) Version() string

type PluginInterface

type PluginInterface interface {
	Name() string
	Key() string
	Desc() string
	Version() string

	Activate()
	Deactivate()
	IsActive() bool

	HasSetting() bool
	Form() string
	SetSetting(settings map[string]string)

	ToStorage() map[string]interface{}
}

func GetPluginByKey

func GetPluginByKey(key string) PluginInterface

Jump to

Keyboard shortcuts

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