runkit

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLocalConfigFile = ".docker/runx.yaml"
)

Variables

This section is empty.

Functions

func Decorate

func Decorate(ctx context.Context, src, dest string, runxConfig, runxDoc []byte) error

Types

type Action added in v0.0.3

type Action struct {
	ID      string     `yaml:"id" json:"id"`
	Desc    string     `yaml:"desc,omitempty" json:"desc,omitempty"`
	Type    ActionType `yaml:"type" json:"type"`
	Command string     `yaml:"cmd" json:"cmd,omitempty"`
	Env     []string   `yaml:"env,omitempty" json:"env,omitempty"`
	Options []Opt      `yaml:"opts,omitempty" json:"opts,omitempty"`
}

func (Action) GetRunnable added in v0.0.3

func (action Action) GetRunnable(ref string) (*Runnable, error)

type ActionType added in v0.0.3

type ActionType string
const (
	ActionTypeRun ActionType = "run"
)

type Config added in v0.0.4

type Config struct {
	Default string   `yaml:"default,omitempty" json:"default,omitempty"`
	Actions []Action `yaml:"actions" json:"actions"`
}

type ConfigAction added in v0.0.7

type ConfigAction struct {
	Opts map[string]string `yaml:"opts,omitempty" json:"opts,omitempty"`
}

type ConfigImage added in v0.0.7

type ConfigImage struct {
	Default string                  `yaml:"default,omitempty" json:"default,omitempty"`
	Actions map[string]ConfigAction `yaml:"actions,omitempty" json:"actions,omitempty"`
}

type LocalConfig added in v0.0.6

type LocalConfig struct {
	Ref    string                 `yaml:"ref,omitempty" json:"ref,omitempty"`
	Images map[string]ConfigImage `yaml:"images,omitempty" json:"images,omitempty"`
}

func GetLocalConfig added in v0.0.6

func GetLocalConfig() LocalConfig

type Opt added in v0.0.5

type Opt struct {
	Name        string   `yaml:"name" json:"name"`
	Description string   `yaml:"desc" json:"desc,omitempty"`
	Prompt      string   `yaml:"prompt,omitempty" json:"prompt,omitempty"`
	Required    bool     `yaml:"required,omitempty" json:"required,omitempty"`
	Values      []string `yaml:"values,omitempty" json:"values,omitempty"`
}

type RunKit added in v0.0.3

type RunKit struct {
	Config Config
	Readme string
	// contains filtered or unexported fields
}

func Get added in v0.0.3

func Get(ctx context.Context, src string) (*RunKit, error)

func (*RunKit) GetRunnable added in v0.0.3

func (rk *RunKit) GetRunnable(action string) (*Runnable, error)

type Runnable added in v0.0.3

type Runnable struct {
	Command string

	Action Action
	// contains filtered or unexported fields
}

func (*Runnable) Run added in v0.0.3

func (r *Runnable) Run(ctx context.Context) error

func (*Runnable) SetOptionValues added in v0.0.5

func (r *Runnable) SetOptionValues(opts map[string]string) error

type TemplateData added in v0.0.3

type TemplateData struct {
	Ref  string
	Env  map[string]string
	Opts map[string]string
}

Jump to

Keyboard shortcuts

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