Documentation ¶
Overview ¶
Package modules implements all logic needed for interacting with stencil modules and their interaction with a project generated by stencil.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { // Manifest is the module's manifest information/configuration Manifest *configuration.TemplateRepositoryManifest // Name is the name of a module. This should be a valid go // import path. For example: github.com/getoutreach/stencil-base Name string // URI is the underlying URI being used to download this module URI string // Version is the version of this module Version string // contains filtered or unexported fields }
Module is a stencil module that contains template files.
func GetModulesForProject ¶
func GetModulesForProject(ctx context.Context, opts *ModuleResolveOptions) ([]*Module, error)
GetModulesForProject returns a list of modules that have been resolved from the provided project manifest, respecting constraints and channels as needed.
func New ¶
func New(ctx context.Context, uri string, tr *configuration.TemplateRepository, fs billy.Filesystem) (*Module, error)
New creates a new module from a TemplateRepository. Version must be set and can be obtained via the gobox/pkg/cli/updater/resolver package, or by using the GetModulesForProject function.
uri is the URI for the module. If it is an empty string https://+name is used instead.
func (*Module) GetTemplate ¶
GetTemplate returns the go template for this module
func (*Module) RegisterExtensions ¶
RegisterExtensions registers all extensions provided by the given module. If the module is a local file URI then extensions will be sourced from the `./bin` directory of the base of the path.
type ModuleResolveOptions ¶
type ModuleResolveOptions struct { // Token is the token to use to resolve modules Token cfg.SecretData // Log is the logger to use Log slogext.Logger // Manifest is the manifest to resolve modules for. // This can only be supplied if Module is not set. Manifest *configuration.Manifest // Module is the module to resolve dependencies for. // This can only be supplied if Manifest is not // set. This module is automatically added as a // Replacement. Module *Module // Replacements is a map of modules to use instead of ones specified // in the manifest. This is mainly meant for tests/importing of stencil // as this is not resolved and instead requires a module type to be // passed. Replacements map[string]*Module }
ModuleResolveOptions contains options for resolving modules
Directories ¶
Path | Synopsis |
---|---|
Package modulestest contains code for interacting with modules in tests.
|
Package modulestest contains code for interacting with modules in tests. |