util

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TempKoitabPath = "/tmp/koitab"
	KoitabPath     = "/var/lib/koi/koitab"
	ApiKeyPath     = "/var/lib/koi/apikey"
	RunKeyPath     = "/var/lib/koi/runkey"
	UserPath       = "/var/lib/koi/user"
	ApiBase        = "https://api.koi.org"
)

Variables

This section is empty.

Functions

func DashboardApiKey added in v1.0.0

func DashboardApiKey() (string, error)

func DashboardRunKey added in v1.0.0

func DashboardRunKey() (string, error)

func RemoteNewRun

func RemoteNewRun(run Run) error

func RemoteSetFile added in v1.3.0

func RemoteSetFile(file File) error

func RemoteSetJobs

func RemoteSetJobs(jobGroups []JobGroup) error

func RemoteSetKeys added in v1.1.0

func RemoteSetKeys(dashVals Dashboard) error

Types

type Arg

type Arg struct {
	Range   [2]int
	Name    string
	Type    string
	Default string
}

type CronTime

type CronTime [5]CronTimeSection

type CronTimePiece

type CronTimePiece struct {
	From int64
	To   int64
	Div  int64
}

type CronTimeSection

type CronTimeSection []CronTimePiece

type Dashboard

type Dashboard struct {
	DashboardID string
	Salt        string
	ApiKey      string
	JobGroups   []JobGroup
	ManualQueue ManualQueue
}

func RemoteGetDashboard added in v1.4.0

func RemoteGetDashboard() (*Dashboard, error)

func RemoteNewDashboard

func RemoteNewDashboard(dashVals Dashboard) (*Dashboard, error)

type File added in v1.3.0

type File struct {
	DashboardID string
	FilePath    string
	Modified    int64
	Content     string
}

func RemoteGetFile added in v1.3.0

func RemoteGetFile(filePath string) (*File, error)

func RemoteGetFileMetadata added in v1.3.0

func RemoteGetFileMetadata() ([]File, error)

type Flags added in v0.3.0

type Flags struct {
}

type Job

type Job struct {
	// Tag is Name if not empty, otherwise Command. Not JobID because not unique.
	JobTag string

	Name    string
	Flags   Flags
	Trigger Trigger
	Command string
	Args    []Arg
}

func ParseJob

func ParseJob(str string) (*Job, error)

type JobGroup

type JobGroup struct {
	Name string
	Jobs []Job
}

func ParseLines

func ParseLines(lines []string) ([]JobGroup, error)

type ManualQueue

type ManualQueue []ManualQueueItem

func RemoteGetManualQueue

func RemoteGetManualQueue() (ManualQueue, error)

type ManualQueueItem added in v1.0.0

type ManualQueueItem [2]string

type ManualToRun

type ManualToRun struct {
	Timestamp int64
	ToBeRunID string
	JobTag    string
	ArgValues []string
}

type OutputLine

type OutputLine struct {
	Time   time.Time
	String string
}

type Run

type Run struct {
	RunID       string
	DashboardID string
	Job         Job
	Started     time.Time
	Ended       *time.Time
	Output      []OutputLine
	Error       string

	// Calculated by koi service
	Display string
}

type Trigger

type Trigger struct {
	String   string
	Manual   bool
	File     bool
	CronTime *CronTime
}

Jump to

Keyboard shortcuts

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