Documentation ¶
Index ¶
- Variables
- func AddDefaultVars(vars map[string]string) map[string]string
- func LoadConfig(global string, workspaces []string)
- func ReplaceVars(text string, vars map[string]string) string
- type AppendSliceValue
- type Appender
- type ConfigFunction
- type ConfigTask
- type ConfigWorkspace
- type Event
- type FileLogWriter
- type Function
- type InMemoryLogWriter
- type LogWriter
- type Task
- type TaskRun
- type Workspace
- func (ws *Workspace) ActiveTasks() int
- func (ws *Workspace) ExecFunction(task *Task, name string, args ...string) string
- func (ws *Workspace) GetColumn(task *Task, name string) string
- func (ws *Workspace) InactiveTasks() int
- func (ws *Workspace) PercentActive() int
- func (ws *Workspace) PercentInactive() int
- func (ws *Workspace) TotalTasks() int
Constants ¶
This section is empty.
Variables ¶
var ConfigWorkspaces = make(map[string]*ConfigWorkspace)
ConfigWorkspaces is the user workspace configs
var Log bytes.Buffer
Log is the in-memory application log for websysd
var Workspaces = make(map[string]*Workspace)
Workspaces is the user workspaces
Functions ¶
func AddDefaultVars ¶
AddDefaultVars adds the USER, UID, GID and HOME environment variables
func LoadConfig ¶
LoadConfig loads a set of config files
Types ¶
type AppendSliceValue ¶
type AppendSliceValue []string
AppendSliceValue implements the flag.Value interface and allows multiple calls to the same variable to append a list.
func (*AppendSliceValue) Set ¶
func (s *AppendSliceValue) Set(value string) error
Set implements flag.Value.Set
func (*AppendSliceValue) String ¶
func (s *AppendSliceValue) String() string
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
Appender is a log appender
type ConfigFunction ¶
ConfigFunction is the config for a function
type ConfigTask ¶
type ConfigTask struct { ID int Name string Command string Environment map[string]string Service bool Executor []string Stdout string Stderr string Metadata map[string]string Pwd string }
ConfigTask is the config for a task
type ConfigWorkspace ¶
type ConfigWorkspace struct { Functions map[string]*ConfigFunction Environment map[string]string Name string Tasks []*ConfigTask IsLocked bool Columns map[string]map[string][]string InheritEnvironment bool }
ConfigWorkspace is the config for a workspace
var GlobalConfigWorkspace *ConfigWorkspace
GlobalConfigWorkspace is the global workspace config
func LoadConfigFile ¶
func LoadConfigFile(file string) (*ConfigWorkspace, error)
LoadConfigFile loads a config file and returns a ConfigWorkspace
type FileLogWriter ¶
type FileLogWriter struct {
// contains filtered or unexported fields
}
FileLogWriter is a log writer for files
func NewFileLogWriter ¶
func NewFileLogWriter(file string) (*FileLogWriter, error)
NewFileLogWriter returns a new FileLogWriter
func (FileLogWriter) String ¶
func (flw FileLogWriter) String() string
type InMemoryLogWriter ¶
type InMemoryLogWriter struct {
// contains filtered or unexported fields
}
InMemoryLogWriter is an in memory log writer
func NewInMemoryLogWriter ¶
func NewInMemoryLogWriter() InMemoryLogWriter
NewInMemoryLogWriter returns a new InMemoryLogWriter
func (InMemoryLogWriter) Len ¶
func (imlw InMemoryLogWriter) Len() int64
Len returns the length of the content
func (InMemoryLogWriter) String ¶
func (imlw InMemoryLogWriter) String() string
type Task ¶
type Task struct { ID int Name string Command string Executor []string Environment map[string]string Stdout string Stderr string Metadata map[string]string Pwd string ActiveTask *TaskRun TaskRuns []*TaskRun Service bool }
Task represents an individual task
func NewTask ¶
func NewTask(workspace *Workspace, name string, executor []string, command string, environment map[string]string, service bool, stdout string, stderr string, metadata map[string]string, pwd string) *Task
NewTask returns a new Task
func (*Task) NewTaskRun ¶
NewTaskRun returns a new TaskRun for the Task
type TaskRun ¶
type Workspace ¶
type Workspace struct { Name string Environment map[string]string Tasks map[string]*Task IsLocked bool Functions map[string]*Function Columns map[string]map[string][]string InheritEnvironment bool }
Workspace is a user workspace
var GlobalWorkspace *Workspace
GlobalWorkspace is the global workspace
func NewWorkspace ¶
func NewWorkspace(name string, environment map[string]string, columns map[string]map[string][]string, inheritEnv bool) *Workspace
NewWorkspace returns a new workspace
func (*Workspace) ActiveTasks ¶
ActiveTasks returns the number of active tasks in a workspace
func (*Workspace) ExecFunction ¶
ExecFunction executes a function task
func (*Workspace) InactiveTasks ¶
InactiveTasks returns the number of inactive tasks in a workspace
func (*Workspace) PercentActive ¶
PercentActive returns the percentage of tasks active in a workspace
func (*Workspace) PercentInactive ¶
PercentInactive returns the percentage of tasks inactive in a workspace
func (*Workspace) TotalTasks ¶
TotalTasks returns the total number of tasks in a workspace