base

package
v0.0.0-...-889047d Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StarlarkResult

func StarlarkResult(r Result) (starlark.Value, error)

Types

type ArgPair

type ArgPair struct {
	Key  string
	Type any
}

type Module

type Module struct {
	Type   string
	Args   []ArgPair
	Action Runnable
	Ctx    context.Context
}

func NewModule

func NewModule(ctx context.Context, fnType string, args []ArgPair, action Runnable) *Module

func (Module) Function

func (m Module) Function() starlarkhelpers.Function

Function produces a starlark Function that has common behavior which is useful for all modules like only_if, not_if, timeout, working_directory

type Result

type Result struct {
	Name    *string
	Output  *string
	Error   error
	Success bool
	Changed bool
	Diff    *string
	Comment string
}

type Runnable

type Runnable interface {
	Run(
		ctx context.Context,
		workingDirectory string,
		moduleName string,
		args starlark.Tuple,
		kwargs []starlark.Tuple,
	) (*Result, error)
}

Jump to

Keyboard shortcuts

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