Versions in this module Expand all Collapse all v0 v0.1.0 Sep 12, 2023 Changes in this version + const CategoryBuild + const CategoryPackage + const CategoryTask + const CategoryTool + var ErrNoSuchModule = errors.New("no such module registered") + func CategoryName(c Category) string + func LogFileNameFormatter(mod ModuleWithMeta) logging.LogFileNameFormatter + type BinaryNamer interface + BinaryName func(ctx context.Context) (binaryName string, err error) + type Category = commonv1.Category + func Categories() []Category + type ContainerBindMount struct + ReadOnly bool + Source string + Target string + type ContainerCapabilities struct + Add []string + Drop []string + type ContainerSpec struct + BindMounts []ContainerBindMount + Capabilities *ContainerCapabilities + Image string + Privileged bool + TmpfsMounts []ContainerTmpfsMount + User string + VolumeMounts []ContainerVolumeMount + func (s ContainerSpec) Mounts() []mount.Mount + type ContainerTmpfsMount struct + ReadOnly bool + Size int64 + Target string + type ContainerVolumeMount struct + Name string + NoCopy bool + ReadOnly bool + Target string + type Example struct + Description string + Name string + Spec ModuleWithMeta + type ExecutionContext interface + BinariesDir func() string + GetState func(ctx context.Context, key string) ([]byte, state.Metadata, error) + Logger func() *slog.Logger + Name func() string + OutDir func() string + SetState func(ctx context.Context, key string, value []byte) error + StdErr func() io.Writer + StdOut func() io.Writer + WorkingDir func() string + type Factory interface + Create func() ModuleWithMeta + type Help struct + Description string + Examples []Example + Name string + type Helper interface + Help func(ctx context.Context) (help Help, err error) + type Initializer interface + Init func(hclCtx *hcl.EvalContext) (Module, error) + type JSONStateEncoder struct + Context ExecutionContext + func NewJSONStateEncoder(ctx ExecutionContext) *JSONStateEncoder[T] + func (j JSONStateEncoder[T]) Get(ctx context.Context, key string) (val T, ok bool, meta state.Metadata, err error) + func (j JSONStateEncoder[T]) Set(ctx context.Context, key string, val T) error + type Metadata struct + Container *ContainerSpec + Deps []string + Id string + InputMapping map[string]string + Module T + ModuleName string + OutputDir string + Skip *bool + func (m *Metadata[T]) Category() Category + func (m *Metadata[T]) ContainerSpec() *ContainerSpec + func (m *Metadata[T]) Dependencies() []string + func (m *Metadata[T]) Execute(ctx ExecutionContext) error + func (m *Metadata[T]) ID() string + func (m *Metadata[T]) InputMappings() (mappings map[string]string) + func (m *Metadata[T]) Name() string + func (m *Metadata[T]) OutDir() string + func (m *Metadata[T]) SetModule(mod Module) + func (m *Metadata[T]) SetName(name string) + func (m *Metadata[T]) ShouldSkip() bool + func (m *Metadata[T]) Type() string + func (m *Metadata[T]) UnmarshalHCL(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics + func (m *Metadata[T]) UnmarshalJSON(bytes []byte) error + func (m *Metadata[T]) UnmarshalModuleSpec(val *commonv1.ModuleSpec) error + func (m *Metadata[T]) Unwrap() Module + type Module interface + Category func() Category + Execute func(ctx ExecutionContext) error + Type func() string + type ModuleFactoryFunc func() ModuleWithMeta + func (f ModuleFactoryFunc) Create() ModuleWithMeta + type ModuleWithMeta interface + ContainerSpec func() *ContainerSpec + Dependencies func() []string + ID func() string + InputMappings func() map[string]string + Name func() string + OutDir func() string + SetModule func(m Module) + SetName func(name string) + ShouldSkip func() bool + UnmarshalHCL func(body hcl.Body, ctx *hcl.EvalContext) hcl.Diagnostics + Unwrap func() Module + type Registration interface + RegisterAt func(registry *TypeRegistry) + type RegistrationFunc func(registry *TypeRegistry) + func (f RegistrationFunc) RegisterAt(registry *TypeRegistry) + type Repository struct + func (s *Repository) Builds() map[string]ModuleWithMeta + func (s *Repository) Module(moduleType Category, moduleName string) ModuleWithMeta + func (s *Repository) ModuleByID(id string) ModuleWithMeta + func (s *Repository) ModulesByCategory(moduleType Category) map[string]ModuleWithMeta + func (s *Repository) RegisterModules(modules ...ModuleWithMeta) + func (s *Repository) Tasks() map[string]ModuleWithMeta + func (s *Repository) Tools() map[string]ModuleWithMeta + type StateEncoder interface + Get func(ctx context.Context, key string) (val T, ok bool, meta state.Metadata, err error) + Set func(ctx context.Context, key string, val T) error + type TestExecutionContext struct + OutputDirectory string + StateStore state.Store + TB testing.TB + TestWorkingDir string + func (t TestExecutionContext) BinariesDir() string + func (t TestExecutionContext) GetState(ctx context.Context, key string) ([]byte, state.Metadata, error) + func (t TestExecutionContext) Logger() *slog.Logger + func (t TestExecutionContext) Name() string + func (t TestExecutionContext) OutDir() string + func (t TestExecutionContext) SetState(ctx context.Context, key string, value []byte) error + func (t TestExecutionContext) StdErr() io.Writer + func (t TestExecutionContext) StdOut() io.Writer + func (t TestExecutionContext) WorkingDir() string + type ToolModule interface + type TypeRegistry struct + func NewRegistry(registrations ...Registration) *TypeRegistry + func (r *TypeRegistry) Create(moduleCategory Category, moduleType string) (ModuleWithMeta, error) + func (r *TypeRegistry) CreateFromHCL(moduleCategory Category, moduleType string, body hcl.Body, ...) (ModuleWithMeta, error) + func (r *TypeRegistry) Inventory() (inventory map[Category][]string) + func (r *TypeRegistry) RegisterModule(factory Factory)