runner

package
v0.0.0-...-f608c71 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	StdOut []BufferOut `json:"stdOut"`
	StdLog []BufferOut `json:"stdLog"`
	StdErr []BufferOut `json:"stdErr"`
}

Buffer holds log entries per stream.

type BufferOut

type BufferOut struct {
	Time   time.Time `json:"time"`
	Text   string    `json:"text"`
	Path   string    `json:"path"`
	Type   string    `json:"type"`
	Stream string    `json:"stream"`
	Errors []string  `json:"errors"`
}

BufferOut is one log entry exchanged between CLI and web UI.

type Command

type Command struct {
	Cmd    string `yaml:"command" json:"command"`
	Type   string `yaml:"type" json:"type"`
	Path   string `yaml:"path,omitempty" json:"path,omitempty"`
	Global bool   `yaml:"global,omitempty" json:"global,omitempty"`
	Output bool   `yaml:"output,omitempty" json:"output,omitempty"`
}

Command fields

type Context

type Context struct {
	Path    string
	Project *Project
	Stop    <-chan bool
	Watcher watcher.FileWatcher
	Event   fsnotify.Event
}

Context is passed to lifecycle callbacks.

type Func

type Func func(Context)

Func is a callback invoked on project lifecycle events.

type Hooks

type Hooks struct {
	After    Func
	Before   Func
	Err      Func
	Change   Func
	Reload   Func
	Settings *config.Settings
	Sync     chan string
}

Hooks holds runtime callbacks and settings injected into a Project by Realize.

type Ignore

type Ignore struct {
	Exts  []string `yaml:"exts,omitempty" json:"exts,omitempty"`
	Paths []string `yaml:"paths,omitempty" json:"paths,omitempty"`
}

Ignore lists exts/paths to skip.

type Project

type Project struct {

	// public fields
	Name       string            `yaml:"name" json:"name"`
	Path       string            `yaml:"path" json:"path"`
	Env        map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	Args       []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Tools      Tools             `yaml:"commands" json:"commands"`
	Watcher    Watch             `yaml:"watcher" json:"watcher"`
	Buffer     Buffer            `yaml:"-" json:"buffer"`
	ErrPattern string            `yaml:"pattern,omitempty" json:"pattern,omitempty"`
	// contains filtered or unexported fields
}

Project holds all project config and runtime state.

func (*Project) After

func (p *Project) After()

After runs after the watcher stops.

func (*Project) Before

func (p *Project) Before()

Before runs before the watcher starts.

func (*Project) Change

func (p *Project) Change(event fsnotify.Event)

Change handles a file change event.

func (*Project) CloseExit

func (p *Project) CloseExit()

CloseExit closes the exit channel.

func (*Project) Err

func (p *Project) Err(err error)

Err handles an error event.

func (*Project) GetExit

func (p *Project) GetExit() chan os.Signal

GetExit returns the exit channel.

func (*Project) InitExit

func (p *Project) InitExit()

InitExit initialises the exit channel.

func (*Project) IsExitOpen

func (p *Project) IsExitOpen() bool

IsExitOpen reports whether the exit channel is non-nil.

func (*Project) Reload

func (p *Project) Reload(path string, stop <-chan bool)

Reload launches the toolchain rebuild.

func (*Project) SetHooks

func (p *Project) SetHooks(h Hooks)

SetHooks injects runtime hooks and settings into the project.

func (*Project) Validate

func (p *Project) Validate(path string, fcheck bool) bool

Validate checks whether a path should be watched.

func (*Project) Watch

func (p *Project) Watch(wg *sync.WaitGroup)

Watch watches the project for file changes.

type Response

type Response struct {
	Name string
	Out  string
	Err  error
}

Response holds the result of a command execution.

type Schema

type Schema struct {
	Projects []Project `yaml:"schema" json:"schema"`
}

Schema holds the project list.

func (*Schema) Add

func (s *Schema) Add(p Project)

func (*Schema) Filter

func (s *Schema) Filter(field string, value interface{}) []Project

func (*Schema) New

func (s *Schema) New(c *cli.Context) Project

func (*Schema) Remove

func (s *Schema) Remove(name string) error

type Tool

type Tool struct {
	Args   []string `yaml:"args,omitempty" json:"args,omitempty"`
	Method string   `yaml:"method,omitempty" json:"method,omitempty"`
	Path   string   `yaml:"path,omitempty" json:"path,omitempty"`
	Dir    string   `yaml:"dir,omitempty" json:"dir,omitempty"`
	Status bool     `yaml:"status,omitempty" json:"status,omitempty"`
	Output bool     `yaml:"output,omitempty" json:"output,omitempty"`
	// contains filtered or unexported fields
}

Tool info

func (*Tool) Compile

func (t *Tool) Compile(path string, stop <-chan bool) (response Response)

Compile runs go build or go install.

func (*Tool) Exec

func (t *Tool) Exec(path string, stop <-chan bool) (response Response)

Exec runs a go tool against a file or directory.

type Tools

type Tools struct {
	Clean    Tool `yaml:"clean,omitempty" json:"clean,omitempty"`
	Vet      Tool `yaml:"vet,omitempty" json:"vet,omitempty"`
	Fmt      Tool `yaml:"fmt,omitempty" json:"fmt,omitempty"`
	Test     Tool `yaml:"test,omitempty" json:"test,omitempty"`
	Generate Tool `yaml:"generate,omitempty" json:"generate,omitempty"`
	Install  Tool `yaml:"install,omitempty" json:"install,omitempty"`
	Build    Tool `yaml:"build,omitempty" json:"build,omitempty"`
	Run      Tool `yaml:"run,omitempty" json:"run,omitempty"`
	// contains filtered or unexported fields
}

Tools go

func (*Tools) Setup

func (t *Tools) Setup(logRecovery bool)

Setup configures go tools for execution. logRecovery enables debug logging.

type Watch

type Watch struct {
	Exts    []string  `yaml:"extensions" json:"extensions"`
	Paths   []string  `yaml:"paths" json:"paths"`
	Scripts []Command `yaml:"scripts,omitempty" json:"scripts,omitempty"`
	Hidden  bool      `yaml:"hidden,omitempty" json:"hidden,omitempty"`
	Ignore  []string  `yaml:"ignored_paths,omitempty" json:"ignored_paths,omitempty"`
}

Watch info

Jump to

Keyboard shortcuts

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