event

package
v0.0.0-...-e99be67 Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 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"

	// get step initializing
	EventTypeInitializeGet atc.EventType = "initialize-get"

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

	// put step initializing
	EventTypeInitializePut atc.EventType = "initialize-put"

	// 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 Envelope

type Envelope struct {
	Data    *json.RawMessage `json:"data"`
	Event   atc.EventType    `json:"event"`
	Version atc.EventVersion `json:"version"`
}

type Error

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

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) EventType

func (ErrorV10) EventType() atc.EventType

func (ErrorV10) Version

func (ErrorV10) Version() atc.EventVersion

type ErrorV20

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

func (ErrorV20) EventType

func (ErrorV20) EventType() atc.EventType

func (ErrorV20) Version

func (ErrorV20) Version() atc.EventVersion

type ErrorV30

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

func (ErrorV30) EventType

func (ErrorV30) EventType() atc.EventType

func (ErrorV30) Version

func (ErrorV30) 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) 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) EventType

func (FinishGetV10) EventType() atc.EventType

func (FinishGetV10) Version

func (FinishGetV10) Version() atc.EventVersion

type FinishGetV20

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

func (FinishGetV20) EventType

func (FinishGetV20) EventType() atc.EventType

func (FinishGetV20) Version

func (FinishGetV20) Version() atc.EventVersion

type FinishGetV30

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

func (FinishGetV30) EventType

func (FinishGetV30) EventType() atc.EventType

func (FinishGetV30) Version

func (FinishGetV30) 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) 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) EventType

func (FinishPutV10) EventType() atc.EventType

func (FinishPutV10) Version

func (FinishPutV10) Version() atc.EventVersion

type FinishPutV20

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

func (FinishPutV20) EventType

func (FinishPutV20) EventType() atc.EventType

func (FinishPutV20) Version

func (FinishPutV20) Version() atc.EventVersion

type FinishPutV30

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

func (FinishPutV30) EventType

func (FinishPutV30) EventType() atc.EventType

func (FinishPutV30) Version

func (FinishPutV30) Version() atc.EventVersion

type FinishTask

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

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) EventType

func (FinishTaskV10) EventType() atc.EventType

func (FinishTaskV10) Version

func (FinishTaskV10) Version() atc.EventVersion

type FinishTaskV20

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

func (FinishTaskV20) EventType

func (FinishTaskV20) EventType() atc.EventType

func (FinishTaskV20) Version

func (FinishTaskV20) Version() atc.EventVersion

type FinishTaskV30

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

func (FinishTaskV30) EventType

func (FinishTaskV30) EventType() atc.EventType

func (FinishTaskV30) Version

func (FinishTaskV30) Version() atc.EventVersion

type FinishV10

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

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"`
	Version  atc.Version `json:"version"`
}

type InitializeGet

type InitializeGet struct {
	Origin Origin `json:"origin"`
}

func (InitializeGet) EventType

func (InitializeGet) EventType() atc.EventType

func (InitializeGet) Version

func (InitializeGet) Version() atc.EventVersion

type InitializePut

type InitializePut struct {
	Origin Origin `json:"origin"`
}

func (InitializePut) EventType

func (InitializePut) EventType() atc.EventType

func (InitializePut) Version

func (InitializePut) Version() atc.EventVersion

type InitializeTask

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

func (InitializeTask) EventType

func (InitializeTask) EventType() atc.EventType

func (InitializeTask) Version

func (InitializeTask) Version() atc.EventVersion

type InitializeTaskV10

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

func (InitializeTaskV10) EventType

func (InitializeTaskV10) EventType() atc.EventType

func (InitializeTaskV10) Version

type InitializeTaskV20

type InitializeTaskV20 struct {
	TaskConfig TaskConfig `json:"config"`
	Origin     OriginV30  `json:"origin"`
}

func (InitializeTaskV20) EventType

func (InitializeTaskV20) EventType() atc.EventType

func (InitializeTaskV20) Version

type InitializeTaskV30

type InitializeTaskV30 struct {
	TaskConfig TaskConfig `json:"config"`
	Origin     OriginV40  `json:"origin"`
}

func (InitializeTaskV30) EventType

func (InitializeTaskV30) EventType() atc.EventType

func (InitializeTaskV30) Version

type InitializeV10

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

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) 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) 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"`
}

type LegacyTurbineInput

type LegacyTurbineInput struct {
	Name     string                 `json:"name"`
	Resource string                 `json:"resource"`
	Type     string                 `json:"type"`
	Version  map[string]interface{} `json:"version,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"`
	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) 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) 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) EventType

func (LogV20) EventType() atc.EventType

func (LogV20) Version

func (LogV20) Version() atc.EventVersion

type LogV30

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

func (LogV30) EventType

func (LogV30) EventType() atc.EventType

func (LogV30) Version

func (LogV30) Version() atc.EventVersion

type LogV40

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

func (LogV40) EventType

func (LogV40) EventType() atc.EventType

func (LogV40) Version

func (LogV40) 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 {
	ID     OriginID     `json:"id,omitempty"`
	Source OriginSource `json:"source,omitempty"`
}

type OriginID

type OriginID string

type OriginSource

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

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 OriginV30

type OriginV30 struct {
	Name     string            `json:"name"`
	Type     OriginV30Type     `json:"type"`
	Source   OriginV30Source   `json:"source"`
	Location OriginV30Location `json:"location,omitempty"`
	Hook     string            `json:"hook"`
}

type OriginV30Location

type OriginV30Location struct {
	ParentID      uint   `json:"parent_id"`
	ID            uint   `json:"id"`
	ParallelGroup uint   `json:"parallel_group"`
	SerialGroup   uint   `json:"serial_group"`
	Hook          string `json:"hook"`
}

type OriginV30LocationIncrement

type OriginV30LocationIncrement uint
const (
	NoIncrementV20     OriginV30LocationIncrement = 0
	SingleIncrementV20 OriginV30LocationIncrement = 1
)

type OriginV30Source

type OriginV30Source string
const (
	OriginV30SourceStdout OriginV30Source = "stdout"
	OriginV30SourceStderr OriginV30Source = "stderr"
)

type OriginV30Type

type OriginV30Type string
const (
	OriginV30TypeInvalid OriginV30Type = ""
	OriginV30TypeGet     OriginV30Type = "get"
	OriginV30TypePut     OriginV30Type = "put"
	OriginV30TypeTask    OriginV30Type = "task"
)

type OriginV40

type OriginV40 struct {
	Name     string            `json:"name"`
	Type     OriginV40Type     `json:"type"`
	Source   OriginSource      `json:"source"`
	Location OriginV40Location `json:"location,omitempty"`
}

type OriginV40Location

type OriginV40Location struct {
	ParentID      uint   `json:"parent_id"`
	ID            uint   `json:"id"`
	ParallelGroup uint   `json:"parallel_group"`
	SerialGroup   uint   `json:"serial_group"`
	Hook          string `json:"hook"`
}

func (OriginV40Location) Incr

func (OriginV40Location) SetParentID

func (ol OriginV40Location) SetParentID(id uint) OriginV40Location

type OriginV40LocationIncrement

type OriginV40LocationIncrement uint
const (
	NoIncrementV30     OriginV40LocationIncrement = 0
	SingleIncrementV30 OriginV40LocationIncrement = 1
)

type OriginV40Type

type OriginV40Type string
const (
	OriginV40TypeInvalid OriginV40Type = ""
	OriginV40TypeGet     OriginV40Type = "get"
	OriginV40TypePut     OriginV40Type = "put"
	OriginV40TypeTask    OriginV40Type = "task"
)

type OutputV10

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

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) 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 []string `json:"on,omitempty"`
}

type PutPlan

type PutPlan struct {
	Name     string `json:"name"`
	Resource string `json:"resource"`
	Type     string `json:"type"`
}

type StartTask

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

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) EventType

func (StartTaskV10) EventType() atc.EventType

func (StartTaskV10) Version

func (StartTaskV10) Version() atc.EventVersion

type StartTaskV20

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

func (StartTaskV20) EventType

func (StartTaskV20) EventType() atc.EventType

func (StartTaskV20) Version

func (StartTaskV20) Version() atc.EventVersion

type StartTaskV30

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

func (StartTaskV30) EventType

func (StartTaskV30) EventType() atc.EventType

func (StartTaskV30) Version

func (StartTaskV30) Version() atc.EventVersion

type StartV10

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

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) EventType

func (Status) EventType() atc.EventType

func (Status) Version

func (Status) Version() atc.EventVersion

type TaskConfig

type TaskConfig struct {
	Platform string `json:"platform"`
	Image    string `json:"image"`

	Run    TaskRunConfig     `json:"run"`
	Inputs []TaskInputConfig `json:"inputs"`
}

shadow the real atc.TaskConfig

func ShadowTaskConfig

func ShadowTaskConfig(config atc.TaskConfig) TaskConfig

type TaskInputConfig

type TaskInputConfig struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type TaskRunConfig

type TaskRunConfig struct {
	Path string   `json:"path"`
	Args []string `json:"args"`
	Dir  string   `json:"dir"`
}

Jump to

Keyboard shortcuts

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