Documentation ¶
Index ¶
- type Callback
- type CreateRunOptions
- type Data
- type DefaultAndMax
- type EnvVariable
- type Event
- func NewFinishEvent(id string, runID string, time time.Time, stage string, exitData ExitDataStage) Event
- func NewFirstEvent(id string, runID string, time time.Time) Event
- func NewLastEvent(id string, runID string, time time.Time) Event
- func NewLogEvent(id string, runID string, time time.Time, stage string, stream string, ...) Event
- func NewStartEvent(id string, runID string, time time.Time, stage string) Event
- type ExitData
- type ExitDataStage
- type FinishData
- type FirstData
- type Hello
- type JSONEvent
- type JSONUsage
- type LastData
- type LogData
- type MemoryUsageData
- type NetworkUsageData
- type Run
- type StageUsage
- type StartData
- type StartRunOptions
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback struct {
URL string `json:"url"`
}
Callback represents what we need to know to make a particular callback request This is not just a string so that we could support adding headers or other special things in the callback request
type CreateRunOptions ¶
type CreateRunOptions struct {
APIKey string
}
type DefaultAndMax ¶
DefaultAndMax is a useful type for int64 resources that have a default and a maximum value
type EnvVariable ¶
EnvVariable is the name and value of an environment variable
type Event ¶
type Event struct { ID string `json:"id,omitempty"` RunID string `json:"run_id"` Time time.Time `json:"time"` Type string `json:"type"` Data Data `json:"data"` }
Event is the top level struct for representing events
func NewFinishEvent ¶
func NewFinishEvent(id string, runID string, time time.Time, stage string, exitData ExitDataStage) Event
NewFinishEvent creates and returns a new finish event
func NewFirstEvent ¶
NewFirstEvent creates and returns a new last event
func NewLastEvent ¶
NewLastEvent creates and returns a new last event
func NewLogEvent ¶
func NewLogEvent(id string, runID string, time time.Time, stage string, stream string, text string) Event
NewLogEvent creates and returns a new log event
func NewStartEvent ¶
NewStartEvent creates and returns a new start event
func (*Event) UnmarshalJSON ¶
UnmarshalJSON converts json to EventWrapper
type ExitData ¶
type ExitData struct { Build *ExitDataStage `json:"build,omitempty"` Execute *ExitDataStage `json:"execute,omitempty"` Finished bool `json:"finished"` }
ExitData holds information about how things ran and how much resources were used
type ExitDataStage ¶
type ExitDataStage struct { ExitCode int `json:"exit_code"` Usage StageUsage `json:"usage"` }
ExitDataStage gives the exit data for a single stage
type FinishData ¶
type FinishData struct { Stage string `json:"stage"` ExitData ExitDataStage `json:"exit_data"` }
FinishData represent the completion of a build or run
type Hello ¶
type Hello struct { Message string `json:"message"` MaxRunTime DefaultAndMax `json:"max_run_time"` Memory DefaultAndMax `json:"memory"` Version string `json:"version"` RunnerImage string `json:"runner_image"` }
Hello gives some basic useful information about the server
type JSONEvent ¶
type JSONEvent struct { ID string `json:"id"` RunID string `json:"run_id"` Time time.Time `json:"time"` Type string `json:"type"` Data *json.RawMessage `json:"data"` }
JSONEvent is used for reading JSON
type JSONUsage ¶
type JSONUsage struct { Time time.Time `json:"time"` RunID string `json:"run_id"` Type string `json:"type"` Data *json.RawMessage `json:"data"` }
JSONUsage is used for reading JSON
type LogData ¶
type LogData struct { Stage string `json:"stage"` Stream string `json:"stream"` Text string `json:"text"` }
LogData is the output of some text from the build or run of a scraper
type MemoryUsageData ¶
type NetworkUsageData ¶
type Run ¶
type Run struct {
ID string `json:"id"`
}
Run is what you get when you create a run and what you need to update it
type StageUsage ¶
type StageUsage struct { MaxRSS uint64 `json:"max_rss"` // In bytes NetworkIn uint64 `json:"network_in"` // In bytes NetworkOut uint64 `json:"network_out"` // In bytes }
Usage gives the resource usage for a single stage
type StartData ¶
type StartData struct {
Stage string `json:"stage"`
}
StartData represents the start of a build or run
type StartRunOptions ¶
type StartRunOptions struct { Output string `json:"output"` Callback Callback `json:"callback"` Env []EnvVariable `json:"env"` MaxRunTime int64 `json:"max_run_time"` Memory int64 `json:"memory"` }
StartRunOptions are options that can be used when starting a run
type Usage ¶
type Usage struct { Time time.Time `json:"time"` RunID string `json:"run_id"` Type string `json:"type"` Data interface{} `json:"data"` }
Usage is the top level struct for representing usage that's reported externally
func NewMemoryUsage ¶
NewMemoryUsage creates and returns a new memory usage
func NewNetworkUsage ¶
NewNetworkUsage creates and returns a new network usage
func (*Usage) UnmarshalJSON ¶
UnmarshalJSON converts json to EventWrapper