shell

package
v0.9.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Source added in v0.9.0

func Source() string

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
}

func (*Hook) GoString

func (s *Hook) GoString() string

func (*Hook) String

func (s *Hook) String() string

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

type HookGenerator struct {
	Out       *bytes.Buffer
	Templates *template.Template
}

func (*HookGenerator) Generate

func (g *HookGenerator) Generate(config HookConfig) (hook *Hook, err error)

func (*HookGenerator) Write

func (g *HookGenerator) Write(p []byte) (n int, err error)

type HookSectionsApplyFn

type HookSectionsApplyFn func(*Sections) *Sections

type HookSubApplyFn

type HookSubApplyFn func(config *HookConfig, applySelectorFn ...HookApplySelectorFn)

type InSelectorApplyFn

type InSelectorApplyFn func(cfg *HookConfig) (applyOn interface{})

type MapFn

type MapFn func(in interface{}) (mappedOut interface{})

type RootCfgNode

type RootCfgNode interface {
	CfgNode
}

type SDK

type SDK struct {
	SDK, Path string
}

type SDKList

type SDKList []SDK

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 NewSection(section string, data interface{}) (out *Section)

func (*Section) Apply

func (s *Section) Apply(applyFn SectionApplyFn) (out *Section)

func (*Section) Execute

func (s *Section) Execute(w io.Writer, data interface{})

func (*Section) GetDefaultTemplate

func (s *Section) GetDefaultTemplate() *template.Template

func (*Section) InitializeWithRootNode

func (s *Section) InitializeWithRootNode(r RootCfgNode) *Section

func (Section) IsRooted

func (c Section) IsRooted() bool

func (Section) Map

func (c Section) Map(selector func(*HookConfig) (interface{}, error)) (out interface{}, err error)

func (Section) NextParent

func (c Section) NextParent() (node CfgNode, ok bool)

func (Section) Parent

func (c Section) Parent() CfgNode

func (Section) Render

func (s Section) Render() string

func (*Section) RootNode

func (s *Section) RootNode() (root RootCfgNode)

type SectionApplyFn

type SectionApplyFn func(in *Section) (out *Section)

type Sections

type Sections map[string]Section

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)

Jump to

Keyboard shortcuts

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