event

package
v0.0.0-...-0e89551 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeInvalid atc.EventType = ""

	// build log (e.g. from input or build execution)
	EventTypeLog atc.EventType = "log"

	// build status change (e.g. 'started', 'succeeded')
	EventTypeStatus atc.EventType = "status"

	// task initializing (all inputs fetched; fetching image)
	EventTypeInitializeTask atc.EventType = "initialize-task"

	// task execution started
	EventTypeStartTask atc.EventType = "start-task"

	// task execution finished
	EventTypeFinishTask atc.EventType = "finish-task"

	// finished getting something
	EventTypeFinishGet atc.EventType = "finish-get"

	// finished putting something
	EventTypeFinishPut atc.EventType = "finish-put"

	// error occurred
	EventTypeError atc.EventType = "error"
)

Variables

This section is empty.

Functions

func ParseEvent

func ParseEvent(version atc.EventVersion, typ atc.EventType, payload []byte) (atc.Event, error)

Types

type Error

type Error struct {
	Message string `json:"message"`
	Origin  Origin `json:"origin,omitempty"`
}

func (Error) Censored

func (e Error) Censored() atc.Event

func (Error) EventType

func (Error) EventType() atc.EventType

func (Error) Version

func (Error) Version() atc.EventVersion

type ErrorV10

type ErrorV10 struct {
	Message string    `json:"message"`
	Origin  OriginV20 `json:"origin,omitempty"`
}

func (ErrorV10) Censored

func (e ErrorV10) Censored() atc.Event

func (ErrorV10) EventType

func (ErrorV10) EventType() atc.EventType

func (ErrorV10) Version

func (ErrorV10) Version() atc.EventVersion

type FinishGet

type FinishGet struct {
	Origin          Origin              `json:"origin"`
	Plan            GetPlan             `json:"plan"`
	ExitStatus      int                 `json:"exit_status"`
	FetchedVersion  atc.Version         `json:"version"`
	FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"`
}

func (FinishGet) Censored

func (e FinishGet) Censored() atc.Event

func (FinishGet) EventType

func (FinishGet) EventType() atc.EventType

func (FinishGet) Version

func (FinishGet) Version() atc.EventVersion

type FinishGetV10

type FinishGetV10 struct {
	Origin          OriginV20           `json:"origin"`
	Plan            GetPlan             `json:"plan"`
	ExitStatus      int                 `json:"exit_status"`
	FetchedVersion  atc.Version         `json:"version"`
	FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"`
}

func (FinishGetV10) Censored

func (e FinishGetV10) Censored() atc.Event

func (FinishGetV10) EventType

func (FinishGetV10) EventType() atc.EventType

func (FinishGetV10) Version

func (FinishGetV10) Version() atc.EventVersion

type FinishPut

type FinishPut struct {
	Origin          Origin              `json:"origin"`
	Plan            PutPlan             `json:"plan"`
	CreatedVersion  atc.Version         `json:"version"`
	CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"`
	ExitStatus      int                 `json:"exit_status"`
}

func (FinishPut) Censored

func (e FinishPut) Censored() atc.Event

func (FinishPut) EventType

func (FinishPut) EventType() atc.EventType

func (FinishPut) Version

func (FinishPut) Version() atc.EventVersion

type FinishPutV10

type FinishPutV10 struct {
	Origin          OriginV20           `json:"origin"`
	Plan            PutPlan             `json:"plan"`
	CreatedVersion  atc.Version         `json:"version"`
	CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"`
	ExitStatus      int                 `json:"exit_status"`
}

func (FinishPutV10) Censored

func (e FinishPutV10) Censored() atc.Event

func (FinishPutV10) EventType

func (FinishPutV10) EventType() atc.EventType

func (FinishPutV10) Version

func (FinishPutV10) Version() atc.EventVersion

type FinishTask

type FinishTask struct {
	Time       int64  `json:"time"`
	ExitStatus int    `json:"exit_status"`
	Origin     Origin `json:"origin"`
}

func (FinishTask) Censored

func (e FinishTask) Censored() atc.Event

func (FinishTask) EventType

func (FinishTask) EventType() atc.EventType

func (FinishTask) Version

func (FinishTask) Version() atc.EventVersion

type FinishTaskV10

type FinishTaskV10 struct {
	Time       int64     `json:"time"`
	ExitStatus int       `json:"exit_status"`
	Origin     OriginV20 `json:"origin"`
}

func (FinishTaskV10) Censored

func (e FinishTaskV10) Censored() atc.Event

func (FinishTaskV10) EventType

func (FinishTaskV10) EventType() atc.EventType

func (FinishTaskV10) Version

func (FinishTaskV10) Version() atc.EventVersion

type FinishV10

type FinishV10 struct {
	Time       int64 `json:"time"`
	ExitStatus int   `json:"exit_status"`
}

func (FinishV10) Censored

func (e FinishV10) Censored() atc.Event

func (FinishV10) EventType

func (FinishV10) EventType() atc.EventType

func (FinishV10) Version

func (FinishV10) Version() atc.EventVersion

type GetPlan

type GetPlan struct {
	Name     string      `json:"name"`
	Resource string      `json:"resource"`
	Type     string      `json:"type"`
	Source   atc.Source  `json:"source"`
	Params   atc.Params  `json:"params"`
	Version  atc.Version `json:"version"`
}

type InitializeTask

type InitializeTask struct {
	TaskConfig atc.TaskConfig `json:"config"`
	Origin     Origin         `json:"origin"`
}

func (InitializeTask) Censored

func (e InitializeTask) Censored() atc.Event

func (InitializeTask) EventType

func (InitializeTask) EventType() atc.EventType

func (InitializeTask) Version

func (InitializeTask) Version() atc.EventVersion

type InitializeTaskV10

type InitializeTaskV10 struct {
	TaskConfig atc.TaskConfig `json:"config"`
	Origin     OriginV20      `json:"origin"`
}

func (InitializeTaskV10) Censored

func (e InitializeTaskV10) Censored() atc.Event

func (InitializeTaskV10) EventType

func (InitializeTaskV10) EventType() atc.EventType

func (InitializeTaskV10) Version

type InitializeV10

type InitializeV10 struct {
	TaskConfig atc.TaskConfig `json:"config"`
}

func (InitializeV10) Censored

func (e InitializeV10) Censored() atc.Event

func (InitializeV10) EventType

func (InitializeV10) EventType() atc.EventType

func (InitializeV10) Version

func (InitializeV10) Version() atc.EventVersion

type InputV10

type InputV10 struct {
	Input LegacyTurbineInput `json:"input"`
}

func (InputV10) Censored

func (e InputV10) Censored() atc.Event

func (InputV10) EventType

func (InputV10) EventType() atc.EventType

func (InputV10) Version

func (InputV10) Version() atc.EventVersion

type InputV20

type InputV20 struct {
	Plan            InputV20InputPlan   `json:"plan"`
	FetchedVersion  atc.Version         `json:"version"`
	FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"`
}

func (InputV20) Censored

func (e InputV20) Censored() atc.Event

func (InputV20) EventType

func (InputV20) EventType() atc.EventType

func (InputV20) Version

func (InputV20) Version() atc.EventVersion

type InputV20InputPlan

type InputV20InputPlan struct {
	// logical name of the input with respect to the task's config
	Name string `json:"name"`

	// name of resource providing the input
	Resource string `json:"resource"`

	// type of resource
	Type string `json:"type"`

	// e.g. sha
	Version atc.Version `json:"version,omitempty"`

	// e.g. git url, branch, private_key
	Source atc.Source `json:"source,omitempty"`

	// arbitrary config for input
	Params atc.Params `json:"params,omitempty"`
}

type LegacyTurbineInput

type LegacyTurbineInput struct {
	Name     string                 `json:"name"`
	Resource string                 `json:"resource"`
	Type     string                 `json:"type"`
	Version  map[string]interface{} `json:"version,omitempty"`
	Source   map[string]interface{} `json:"source,omitempty"`
	Params   map[string]interface{} `json:"params,omitempty"`
	Metadata []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"metadata,omitempty"`
	ConfigPath string `json:"config_path"`
}

type LegacyTurbineOutput

type LegacyTurbineOutput struct {
	Name     string                 `json:"name"`
	Type     string                 `json:"type"`
	On       []string               `json:"on,omitempty"`
	Version  map[string]interface{} `json:"version,omitempty"`
	Source   map[string]interface{} `json:"source,omitempty"`
	Params   map[string]interface{} `json:"params,omitempty"`
	Metadata []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"metadata,omitempty"`
}

type Log

type Log struct {
	Origin  Origin `json:"origin"`
	Payload string `json:"payload"`
}

func (Log) Censored

func (e Log) Censored() atc.Event

func (Log) EventType

func (Log) EventType() atc.EventType

func (Log) Version

func (Log) Version() atc.EventVersion

type LogV10

type LogV10 struct {
	Origin  OriginV10 `json:"origin"`
	Payload string    `json:"payload"`
}

func (LogV10) Censored

func (e LogV10) Censored() atc.Event

func (LogV10) EventType

func (LogV10) EventType() atc.EventType

func (LogV10) Version

func (LogV10) Version() atc.EventVersion

type LogV20

type LogV20 struct {
	Origin  OriginV20 `json:"origin"`
	Payload string    `json:"payload"`
}

func (LogV20) Censored

func (e LogV20) Censored() atc.Event

func (LogV20) EventType

func (LogV20) EventType() atc.EventType

func (LogV20) Version

func (LogV20) Version() atc.EventVersion

type Message

type Message struct {
	Event atc.Event
}

func (Message) MarshalJSON

func (m Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(bytes []byte) error

type Origin

type Origin struct {
	Name     string         `json:"name"`
	Type     OriginType     `json:"type"`
	Source   OriginSource   `json:"source"`
	Location OriginLocation `json:"location,omitempty"`
	Hook     string         `json:"hook"`
}

type OriginLocation

type OriginLocation struct {
	ParentID      uint `json:"parent_id"`
	ID            uint `json:"id"`
	ParallelGroup uint `json:"parallel_group"`
}

func (OriginLocation) Incr

func (OriginLocation) SetParentID

func (ol OriginLocation) SetParentID(id uint) OriginLocation

type OriginLocationIncrement

type OriginLocationIncrement uint
const (
	NoIncrement     OriginLocationIncrement = 0
	SingleIncrement OriginLocationIncrement = 1
)

type OriginSource

type OriginSource string
const (
	OriginSourceStdout OriginSource = "stdout"
	OriginSourceStderr OriginSource = "stderr"
)

type OriginType

type OriginType string
const (
	OriginTypeInvalid OriginType = ""
	OriginTypeGet     OriginType = "get"
	OriginTypePut     OriginType = "put"
	OriginTypeTask    OriginType = "task"
)

type OriginV10

type OriginV10 struct {
	Type OriginV10Type `json:"type"`
	Name string        `json:"name"`
}

type OriginV10Type

type OriginV10Type string
const (
	OriginV10TypeInvalid OriginV10Type = ""
	OriginV10TypeInput   OriginV10Type = "input"
	OriginV10TypeOutput  OriginV10Type = "output"
	OriginV10TypeRun     OriginV10Type = "run"
)

type OriginV20

type OriginV20 struct {
	Name     string            `json:"name"`
	Type     OriginV20Type     `json:"type"`
	Source   OriginV20Source   `json:"source"`
	Location OriginV20Location `json:"location,omitempty"`
	Substep  bool              `json:"substep"`
	Hook     string            `json:"hook"`
}

type OriginV20Location

type OriginV20Location []uint

type OriginV20LocationIncrement

type OriginV20LocationIncrement uint
const (
	NoIncrementV10     OriginV20LocationIncrement = 0
	SingleIncrementV10 OriginV20LocationIncrement = 1
)

type OriginV20Source

type OriginV20Source string
const (
	OriginV20SourceStdout OriginV20Source = "stdout"
	OriginV20SourceStderr OriginV20Source = "stderr"
)

type OriginV20Type

type OriginV20Type string
const (
	OriginV20TypeInvalid OriginV20Type = ""
	OriginV20TypeGet     OriginV20Type = "get"
	OriginV20TypePut     OriginV20Type = "put"
	OriginV20TypeTask    OriginV20Type = "task"
)

type OutputV10

type OutputV10 struct {
	Output LegacyTurbineOutput `json:"output"`
}

func (OutputV10) Censored

func (e OutputV10) Censored() atc.Event

func (OutputV10) EventType

func (OutputV10) EventType() atc.EventType

func (OutputV10) Version

func (OutputV10) Version() atc.EventVersion

type OutputV20

type OutputV20 struct {
	Plan            OutputV20OutputPlan `json:"plan"`
	CreatedVersion  atc.Version         `json:"version"`
	CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"`
}

func (OutputV20) Censored

func (e OutputV20) Censored() atc.Event

func (OutputV20) EventType

func (OutputV20) EventType() atc.EventType

func (OutputV20) Version

func (OutputV20) Version() atc.EventVersion

type OutputV20OutputPlan

type OutputV20OutputPlan struct {
	Name string `json:"name"`

	Type string `json:"type"`

	// e.g. [success, failure]
	On atc.Conditions `json:"on,omitempty"`

	// e.g. git url, branch, private_key
	Source atc.Source `json:"source,omitempty"`

	// arbitrary config for output
	Params atc.Params `json:"params,omitempty"`
}

type PutPlan

type PutPlan struct {
	Name     string     `json:"name"`
	Resource string     `json:"resource"`
	Type     string     `json:"type"`
	Source   atc.Source `json:"source"`
	Params   atc.Params `json:"params"`
}

type StartTask

type StartTask struct {
	Time   int64  `json:"time"`
	Origin Origin `json:"origin"`
}

func (StartTask) Censored

func (e StartTask) Censored() atc.Event

func (StartTask) EventType

func (StartTask) EventType() atc.EventType

func (StartTask) Version

func (StartTask) Version() atc.EventVersion

type StartTaskV10

type StartTaskV10 struct {
	Time   int64     `json:"time"`
	Origin OriginV20 `json:"origin"`
}

func (StartTaskV10) Censored

func (e StartTaskV10) Censored() atc.Event

func (StartTaskV10) EventType

func (StartTaskV10) EventType() atc.EventType

func (StartTaskV10) Version

func (StartTaskV10) Version() atc.EventVersion

type StartV10

type StartV10 struct {
	Time int64 `json:"time"`
}

func (StartV10) Censored

func (e StartV10) Censored() atc.Event

func (StartV10) EventType

func (StartV10) EventType() atc.EventType

func (StartV10) Version

func (StartV10) Version() atc.EventVersion

type Status

type Status struct {
	Status atc.BuildStatus `json:"status"`
	Time   int64           `json:"time"`
}

func (Status) Censored

func (e Status) Censored() atc.Event

func (Status) EventType

func (Status) EventType() atc.EventType

func (Status) Version

func (Status) Version() atc.EventVersion

Jump to

Keyboard shortcuts

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