app_job

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func TimeFromLog

func TimeFromLog(tl TimingLog, jobId string) (t time.Time, ok bool)

Types

type Historian

type Historian interface {
	// Histories, that guarantee sorted by job id.
	Histories() (histories []History, err error)
}

type History

type History interface {
	JobId() string
	JobPath() string
	RecipeName() string
	Recipe() (r rc_recipe.Spec, found bool)
	AppName() string
	AppVersion() string
	TimeStart() (t time.Time, found bool)
	TimeFinish() (t time.Time, found bool)
	StartLog() StartLog
	ResultLog() ResultLog
	Job() app_workspace.Job

	// True when the job is nested job.
	IsNested() bool

	// True when the job is isolated from workspace.
	IsOrphaned() bool

	// Log files. logs are guaranteed sorted by their file names.
	Logs() (logs []LogFile, err error)
}

type HistoryOperation

type HistoryOperation interface {
	History

	// Archive this job data
	Archive() (path string, err error)

	// Delete this job data
	Delete() error
}

type Launcher

type Launcher interface {
	Up() (ctl app_control.Control, err error)

	// Shutdown job. Please specify err for result of the execution.
	Down(err error, ctl app_control.Control)
}

type LogFile

type LogFile interface {
	// Log file type
	Type() LogFileType

	// Name of the file (not including path)
	Name() string

	// Path to the log.
	Path() string

	// True when the file is compressed.
	IsCompressed() bool

	// Read & copy to the stream
	CopyTo(writer io.Writer) error
}

type LogFileType

type LogFileType string
const (
	LogFileTypeToolbox LogFileType = "toolbox"
	LogFileTypeCapture LogFileType = "capture"
	LogFileTypeSummary LogFileType = "summary"
	LogFileTypeRecipe  LogFileType = "recipe"
	LogFileTypeResult  LogFileType = "result"
)

type ResultLog

type ResultLog struct {
	Success    bool   `json:"success"`
	TimeFinish string `json:"time_finish"`
	Error      string `json:"error"`
}

func (ResultLog) Time

func (z ResultLog) Time() (t time.Time, ok bool)

func (ResultLog) Write

func (z ResultLog) Write(ws app_workspace.Workspace) error

type StartLog

type StartLog struct {
	TimingLog
	Name         string                 `json:"name"`
	ValueObject  map[string]interface{} `json:"value_object"`
	CommonOpts   map[string]interface{} `json:"common_opts"`
	TimeStart    string                 `json:"time_start,omitempty"`
	JobId        string                 `json:"job_id"`
	AppName      string                 `json:"app_name"`
	AppHash      string                 `json:"app_hash"`
	AppVersion   string                 `json:"app_version"`
	RecipeValues interface{}            `json:"recipe_values"`
}

func (StartLog) Time

func (z StartLog) Time() (t time.Time, ok bool)

func (StartLog) Write

func (z StartLog) Write(ws app_workspace.Workspace) error

type TimingLog

type TimingLog interface {
	Time() (t time.Time, ok bool)
}

Jump to

Keyboard shortcuts

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