core

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//StateSuccess successs exit status
	StateSuccess = "SUCCESS"
	//StateError error exist status
	StateError = "ERROR"
	//StateTimeout timeout exit status
	StateTimeout = "TIMEOUT"
	//StateKilled killed exit status
	StateKilled = "KILLED"
	//StateUnknownCmd unknown cmd exit status
	StateUnknownCmd = "UNKNOWN_CMD"
	//StateDuplicateID dublicate id exit status
	StateDuplicateID = "DUPILICATE_ID"
)

Variables

This section is empty.

Functions

func MustArguments

func MustArguments(args interface{}) *json.RawMessage

Types

type Command

type Command struct {
	ID              string           `json:"id"`
	Command         string           `json:"command"`
	Arguments       *json.RawMessage `json:"arguments"`
	Queue           string           `json:"queue"`
	StatsInterval   int              `json:"stats_interval,omitempty"`
	MaxTime         int              `json:"max_time,omitempty"`
	MaxRestart      int              `json:"max_restart,omitempty"`
	RecurringPeriod int              `json:"recurring_period,omitempty"`
	LogLevels       []int            `json:"log_levels,omitempty"`
	Tags            string           `json:"tags"`

	Route Route `json:"-"`
}

Cmd is an executable command

func LoadCmd

func LoadCmd(str []byte) (*Command, error)

LoadCmd loads cmd from json string.

func (*Command) String

func (cmd *Command) String() string

String represents cmd as a string

type JobResult

type JobResult struct {
	ID        string   `json:"id"`
	Command   string   `json:"command"`
	Data      string   `json:"data"`
	Streams   []string `json:"streams,omitempty"`
	Critical  string   `json:"critical,omitempty"`
	Level     int      `json:"level"`
	State     string   `json:"state"`
	StartTime int64    `json:"starttime"`
	Time      int64    `json:"time"`
	Tags      string   `json:"tags"`
	Container uint64   `json:"container"`
}

JobResult represents a result of a job

func NewBasicJobResult

func NewBasicJobResult(cmd *Command) *JobResult

NewBasicJobResult creates a new job result from command

type M

type M map[string]interface{}

type Route

type Route string

Jump to

Keyboard shortcuts

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