Documentation
¶
Index ¶
- func Register(name string, fn CreatorFn)
- type BasePlugin
- func (p *BasePlugin) CheckIsAuthor(ctx *event.EventContext) error
- func (p *BasePlugin) CheckMatchLabels(ctx *event.EventContext, matchLabels []config.MatchLabel) error
- func (p *BasePlugin) CheckPluginPreconditions(ctx *event.EventContext) (err error)
- func (p *BasePlugin) CheckPrecondition(ctx *event.EventContext, precondition config.Precondition) (err error)
- func (p *BasePlugin) CheckPreconditions(ctx *event.EventContext, preconditions []config.Precondition) (err error)
- func (p *BasePlugin) CheckRequiredLabelPrefix(ctx *event.EventContext, prefix []string) error
- func (p *BasePlugin) CheckRequiredLabels(ctx *event.EventContext, labels []string) error
- func (p *BasePlugin) CheckRequiredRoles(ctx *event.EventContext, roles []string) error
- func (p *BasePlugin) GetAlias() config.AliasOptions
- func (p *BasePlugin) GetExtra() interface{}
- func (p *BasePlugin) GetLabelRoles() config.LabelRoles
- func (p *BasePlugin) GetOwner() string
- func (p *BasePlugin) GetPreconditions() []config.Precondition
- func (p *BasePlugin) GetRepo() string
- func (p *BasePlugin) GetRoles() config.RoleOptions
- func (p *BasePlugin) HandleEvent(ctx *event.EventContext) (notSupport bool, err error)
- func (p *BasePlugin) IsSpecifiedRoles(user string, roles []string) bool
- func (p *BasePlugin) IsSupported(ctx *event.EventContext, handlerOptions HandlerOptions) bool
- func (p *BasePlugin) IsSupportedAction(action string, handlerOptions HandlerOptions) bool
- func (p *BasePlugin) IsSupportedEvent(eventType string, handlerOptions HandlerOptions) bool
- func (p *BasePlugin) Name() string
- func (p *BasePlugin) ParseCmdAlias(str string) string
- func (p *BasePlugin) ParseCmdsFromMsg(msg string, onlyOneArg bool) []*Command
- func (p *BasePlugin) ParseLabelAlias(str string) string
- func (p *BasePlugin) ParseUserAlias(str string) string
- func (p *BasePlugin) UnmarshalTo(v interface{}) error
- type Command
- type CreatorFn
- type Handler
- type HandlerOptions
- type Plugin
- type PluginOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasePlugin ¶
type BasePlugin struct {
// contains filtered or unexported fields
}
func NewBasePlugin ¶
func NewBasePlugin(name string, options PluginOptions) *BasePlugin
func (*BasePlugin) CheckIsAuthor ¶
func (p *BasePlugin) CheckIsAuthor(ctx *event.EventContext) error
func (*BasePlugin) CheckMatchLabels ¶
func (p *BasePlugin) CheckMatchLabels(ctx *event.EventContext, matchLabels []config.MatchLabel) error
func (*BasePlugin) CheckPluginPreconditions ¶
func (p *BasePlugin) CheckPluginPreconditions(ctx *event.EventContext) (err error)
func (*BasePlugin) CheckPrecondition ¶
func (p *BasePlugin) CheckPrecondition(ctx *event.EventContext, precondition config.Precondition) (err error)
func (*BasePlugin) CheckPreconditions ¶
func (p *BasePlugin) CheckPreconditions(ctx *event.EventContext, preconditions []config.Precondition) (err error)
func (*BasePlugin) CheckRequiredLabelPrefix ¶
func (p *BasePlugin) CheckRequiredLabelPrefix(ctx *event.EventContext, prefix []string) error
func (*BasePlugin) CheckRequiredLabels ¶
func (p *BasePlugin) CheckRequiredLabels(ctx *event.EventContext, labels []string) error
func (*BasePlugin) CheckRequiredRoles ¶
func (p *BasePlugin) CheckRequiredRoles(ctx *event.EventContext, roles []string) error
func (*BasePlugin) GetAlias ¶
func (p *BasePlugin) GetAlias() config.AliasOptions
func (*BasePlugin) GetExtra ¶
func (p *BasePlugin) GetExtra() interface{}
func (*BasePlugin) GetLabelRoles ¶
func (p *BasePlugin) GetLabelRoles() config.LabelRoles
func (*BasePlugin) GetOwner ¶
func (p *BasePlugin) GetOwner() string
func (*BasePlugin) GetPreconditions ¶
func (p *BasePlugin) GetPreconditions() []config.Precondition
func (*BasePlugin) GetRepo ¶
func (p *BasePlugin) GetRepo() string
func (*BasePlugin) GetRoles ¶
func (p *BasePlugin) GetRoles() config.RoleOptions
func (*BasePlugin) HandleEvent ¶
func (p *BasePlugin) HandleEvent(ctx *event.EventContext) (notSupport bool, err error)
func (*BasePlugin) IsSpecifiedRoles ¶
func (p *BasePlugin) IsSpecifiedRoles(user string, roles []string) bool
func (*BasePlugin) IsSupported ¶
func (p *BasePlugin) IsSupported(ctx *event.EventContext, handlerOptions HandlerOptions) bool
func (*BasePlugin) IsSupportedAction ¶
func (p *BasePlugin) IsSupportedAction(action string, handlerOptions HandlerOptions) bool
func (*BasePlugin) IsSupportedEvent ¶
func (p *BasePlugin) IsSupportedEvent(eventType string, handlerOptions HandlerOptions) bool
func (*BasePlugin) Name ¶
func (p *BasePlugin) Name() string
func (*BasePlugin) ParseCmdAlias ¶
func (p *BasePlugin) ParseCmdAlias(str string) string
func (*BasePlugin) ParseCmdsFromMsg ¶
func (p *BasePlugin) ParseCmdsFromMsg(msg string, onlyOneArg bool) []*Command
func (*BasePlugin) ParseLabelAlias ¶
func (p *BasePlugin) ParseLabelAlias(str string) string
func (*BasePlugin) ParseUserAlias ¶
func (p *BasePlugin) ParseUserAlias(str string) string
func (*BasePlugin) UnmarshalTo ¶
func (p *BasePlugin) UnmarshalTo(v interface{}) error
type CreatorFn ¶
type CreatorFn func(cli client.ClientInterface, notifier notify.NotifyInterface, options PluginOptions) (Plugin, error)
type Handler ¶
type Handler func(ctx *event.EventContext) (err error)
type HandlerOptions ¶
type Plugin ¶
type Plugin interface { Name() string HandleEvent(ctx *event.EventContext) (notSupport bool, err error) }
func Create ¶
func Create(cli client.ClientInterface, notifier notify.NotifyInterface, name string, options PluginOptions) (p Plugin, err error)
type PluginOptions ¶
type PluginOptions struct { Owner string Repo string Alias config.AliasOptions Roles config.RoleOptions LabelRoles config.LabelRoles Preconditions []config.Precondition Extra interface{} // filled by plugin Handlers []HandlerOptions }
func (*PluginOptions) Complete ¶
func (options *PluginOptions) Complete(owner, repo string, alias config.AliasOptions, roles config.RoleOptions, labelRoles config.LabelRoles, preconditions []config.Precondition, extra interface{})
Click to show internal directories.
Click to hide internal directories.