Documentation
¶
Index ¶
- func Source() string
- type CfgNode
- type Configurator
- type DevCtlSectionConfig
- type Hook
- type HookApplyFn
- type HookApplySelectorFn
- type HookApplySelectorFn2
- type HookConfig
- func (c *HookConfig) AddOrUpdateSection(section *Section) *HookConfig
- func (c *HookConfig) AddOrUpdateSectionForKey(name string, section Section) *HookConfig
- func (c *HookConfig) AddOrUpdateSections(sections Sections) *HookConfig
- func (c *HookConfig) Apply(applyFns ...HookApplyFn) *HookConfig
- func (c *HookConfig) ApplyWithSelector(inSelector InSelectorApplyFn, mapFn MapFn, updateSelector UpdateConfigSelector) *HookConfig
- func (c *HookConfig) Get() (root *HookConfig)
- func (c *HookConfig) GetSection(title string) (section Section, ok bool)
- func (c *HookConfig) GetTemplateForSection(section Section) *template.Template
- func (*HookConfig) ListSections() (sections map[string]string)
- func (c *HookConfig) LookupTemplate(templateID string) *template.Template
- func (c *HookConfig) Root() (root *HookConfig)
- type HookGenerator
- type HookSectionsApplyFn
- type HookSubApplyFn
- type InSelectorApplyFn
- type MapFn
- type RootCfgNode
- type SDK
- type SDKList
- type SDKSectionConfig
- type Section
- func (s *Section) Apply(applyFn SectionApplyFn) (out *Section)
- func (s *Section) Execute(w io.Writer, data interface{})
- func (s *Section) GetDefaultTemplate() *template.Template
- func (s *Section) InitializeWithRootNode(r RootCfgNode) *Section
- func (c Section) IsRooted() bool
- func (c Section) Map(selector func(*HookConfig) (interface{}, error)) (out interface{}, err error)
- func (c Section) NextParent() (node CfgNode, ok bool)
- func (c Section) Parent() CfgNode
- func (s Section) Render() string
- func (s *Section) RootNode() (root RootCfgNode)
- type SectionApplyFn
- type Sections
- type UninitializedSection
- type UpdateConfigSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CfgNode ¶
type CfgNode interface {
IsRooted() bool
Parent() CfgNode
RootNode() RootCfgNode
}
type Configurator ¶
type Configurator interface {
Get() (root *HookConfig)
ListSections() (sections []string)
AddOrUpdateSection(name string, section Section) *HookConfig
AddOrUpdateSections(sections Sections) *HookConfig
LookupTemplate(templateID string) *template.Template
}
Configurator provides an api to configure ShellHookConfig
type DevCtlSectionConfig ¶
type DevCtlSectionConfig struct {
Prefix string
}
type Hook ¶
type Hook struct {
ShellScriptString string
Config HookConfig
Buffer *bytes.Buffer
// contains filtered or unexported fields
}
type HookApplyFn ¶
type HookApplyFn func(*HookConfig) *HookConfig
type HookApplySelectorFn ¶
type HookApplySelectorFn func(inSelector InSelectorApplyFn, mapFn MapFn, updateSelector UpdateConfigSelector)
type HookApplySelectorFn2 ¶
type HookApplySelectorFn2 func( inSelector func(cfg *HookConfig) (applyOn interface{}), mapFn func(in interface{}) (mappedOut interface{}), updateConfigSelector func(cfg *HookConfig, mappedOut interface{}) (updatedConfig *HookConfig))
type HookConfig ¶
type HookConfig struct {
Templates *template.Template
Sections Sections
// contains filtered or unexported fields
}
func (*HookConfig) AddOrUpdateSection ¶
func (c *HookConfig) AddOrUpdateSection(section *Section) *HookConfig
AddOrUpdateSection adds or replaces a section of ShellHookConfig
func (*HookConfig) AddOrUpdateSectionForKey ¶
func (c *HookConfig) AddOrUpdateSectionForKey(name string, section Section) *HookConfig
AddOrUpdateSectionForKey adds or replaces a section of ShellHookConfig
func (*HookConfig) AddOrUpdateSections ¶
func (c *HookConfig) AddOrUpdateSections(sections Sections) *HookConfig
func (*HookConfig) Apply ¶
func (c *HookConfig) Apply(applyFns ...HookApplyFn) *HookConfig
func (*HookConfig) ApplyWithSelector ¶
func (c *HookConfig) ApplyWithSelector(inSelector InSelectorApplyFn, mapFn MapFn, updateSelector UpdateConfigSelector) *HookConfig
func (*HookConfig) Get ¶
func (c *HookConfig) Get() (root *HookConfig)
func (*HookConfig) GetSection ¶
func (c *HookConfig) GetSection(title string) (section Section, ok bool)
func (*HookConfig) GetTemplateForSection ¶
func (c *HookConfig) GetTemplateForSection(section Section) *template.Template
func (*HookConfig) ListSections ¶
func (*HookConfig) ListSections() (sections map[string]string)
func (*HookConfig) LookupTemplate ¶
func (c *HookConfig) LookupTemplate(templateID string) *template.Template
func (*HookConfig) Root ¶
func (c *HookConfig) Root() (root *HookConfig)
type HookGenerator ¶
func (*HookGenerator) Generate ¶
func (g *HookGenerator) Generate(config HookConfig) (hook *Hook, err error)
type HookSectionsApplyFn ¶
type HookSubApplyFn ¶
type HookSubApplyFn func(config *HookConfig, applySelectorFn ...HookApplySelectorFn)
type InSelectorApplyFn ¶
type InSelectorApplyFn func(cfg *HookConfig) (applyOn interface{})
type RootCfgNode ¶
type RootCfgNode interface {
CfgNode
}
type SDKSectionConfig ¶
type SDKSectionConfig struct {
SDKs []SDK
}
type Section ¶
type Section struct {
Title string
TemplateID string
Template *template.Template
Data interface{}
// contains filtered or unexported fields
}
func NewDevctlSection ¶
func NewDevctlSection(data DevCtlSectionConfig) *Section
func NewSection ¶
func (*Section) Apply ¶
func (s *Section) Apply(applyFn SectionApplyFn) (out *Section)
func (*Section) GetDefaultTemplate ¶
func (*Section) InitializeWithRootNode ¶
func (s *Section) InitializeWithRootNode(r RootCfgNode) *Section
func (Section) Map ¶
func (c Section) Map(selector func(*HookConfig) (interface{}, error)) (out interface{}, err error)
func (Section) NextParent ¶
func (*Section) RootNode ¶
func (s *Section) RootNode() (root RootCfgNode)
type SectionApplyFn ¶
type UninitializedSection ¶
type UninitializedSection func(cfgNode RootCfgNode) *Section
func CreateUninitializedSection ¶
func CreateUninitializedSection(section string, data interface{}) UninitializedSection
type UpdateConfigSelector ¶
type UpdateConfigSelector func(cfg *HookConfig, mappedOut interface{}) (updatedConfig *HookConfig)
Click to show internal directories.
Click to hide internal directories.