Documentation
¶
Overview ¶
modules provides an extendable interface for executable components in the build pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterModule ¶
func RegisterModule(definition *ModuleRegistration)
RegisterModule allows modules to register themselves during init(), by providing a definition of type ModuleRegistration.
Types ¶
type ModuleRegistration ¶
type ModuleRegistration struct { // Stage is a string representation of the stage the module is // registered into. To register a module into every stage, specify // "*" as stage. Stage string // Type is a string representation of the module's name. Type string // Factory is the factory method to create a new module // with defaults. Factory PluggableFactory }
ModuleRegistration is a Pluggable registration entry for module registration
func (*ModuleRegistration) Kind ¶
func (mod *ModuleRegistration) Kind() string
type PluggableFactory ¶
type PluggableFactory func() Pluggable
PluggableFactory is a method, which yields a Pluggable
func LookupModule ¶
func LookupModule(kind string) (PluggableFactory, bool)
LookupModule returns a PluggableFactory based on its Kind as a side effect, it also flags the module as loaded
type TemplateData ¶
type TemplateData struct { // Algo represents algorithm. Hashing and signing modules use them. Algo string // Arch defines target architecture Arch string // ArchName is a textual representation of Arch, optionally combining 32bit ARM versions // eg. GOARCH=arm GOARM=6 means ArchName=armv6 ArchName string // ArmVersion is the 32bit arm version (supported: 5, 6, 7) ArmVersion int32 // ArchiveName defines a URL where the resource will be remotely available ArchiveName string // Env is a copy of environment variables set in ctx.Context Env *withenv.Env // Git is a copy of git-related info from ctx.Context Git *ctx.GitData // OS defines target operating system OS string // ProjectName defines local filename of the resource ProjectName string // Version defines artifact's version Version string // Ext contains executable extension Ext string }
TemplateData is the data all template-based text replacement takes place. Modules are responsible of filling in the appropriate fields, and handle dependencies (for example, ArchiveName is often depends on ProjectName, therefore modules have to render them in ProjectName then ArchiveName order)
func NewTemplate ¶
func NewTemplate(cx context.Context) (*TemplateData, error)