events

package
v0.0.0-...-e98e7c4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2015 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoEvent = errors.New("no event")
)

Functions

func EventType

func EventType(jsonBlob []byte) (string, error)

Types

type APIPostEvent

type APIPostEvent struct {
	Type string    `json:"eventType"`
	App  *apps.App `json:"appDefinition"`
}

func (APIPostEvent) Apps

func (event APIPostEvent) Apps() []*apps.App

func (APIPostEvent) GetType

func (event APIPostEvent) GetType() string

type AppTerminatedEvent

type AppTerminatedEvent struct {
	Type      string `json:"eventType"`
	AppID     string `json:"appId"`
	Timestamp string `json:"timestamp"`
}

func (AppTerminatedEvent) Apps

func (event AppTerminatedEvent) Apps() []*apps.App

func (AppTerminatedEvent) GetType

func (event AppTerminatedEvent) GetType() string

type BaseEvent

type BaseEvent struct {
	Type string `json:"eventType"`
}

type DeploymentInfoEvent

type DeploymentInfoEvent struct {
	Type string `json:"eventType"`
	Plan struct {
		Target struct {
			Apps []*apps.App `json:"apps"`
		} `json:"target"`
	} `json:"plan"`
	CurrentStep struct {
		Action string `json:"action"`
		App    string `json:"app"`
	} `json:"currentStep"`
}

func (DeploymentInfoEvent) Apps

func (event DeploymentInfoEvent) Apps() []*apps.App

func (DeploymentInfoEvent) GetType

func (event DeploymentInfoEvent) GetType() string

type Event

type Event interface {
	Apps() []*apps.App
	GetType() string
}

func ParseEvent

func ParseEvent(jsonBlob []byte) (event Event, err error)

ParseEvent combines the functions in this module to return an event without the user having to worry about the *type* of the event.

Jump to

Keyboard shortcuts

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