reporter

package
v0.0.0-...-5000e08 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeFind   = "Find"
	EventTypeSelect = "Select"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Datadog

type Datadog struct {
	// contains filtered or unexported fields
}

func NewDatadog

func NewDatadog(config DatadogConfig, logger boshlog.Logger) Datadog

func (Datadog) ReportEventExecutionCompletion

func (r Datadog) ReportEventExecutionCompletion(incidentID string, e Event)

func (Datadog) ReportEventExecutionStart

func (r Datadog) ReportEventExecutionStart(incidentID string, e Event)

func (Datadog) ReportIncidentExecutionCompletion

func (r Datadog) ReportIncidentExecutionCompletion(i Incident)

func (Datadog) ReportIncidentExecutionStart

func (r Datadog) ReportIncidentExecutionStart(i Incident)

type DatadogConfig

type DatadogConfig struct {
	APIKey string
	AppKey string
}

func (DatadogConfig) Required

func (c DatadogConfig) Required() bool

func (DatadogConfig) Validate

func (c DatadogConfig) Validate() error

type Event

type Event struct {
	ID   string // may be empty
	Type string

	Instance EventInstance // may be empty

	ExecutionStartedAt   time.Time
	ExecutionCompletedAt time.Time

	Error error
	// contains filtered or unexported fields
}

func (*Event) ErrorStr

func (e *Event) ErrorStr() string

func (*Event) IsAction

func (e *Event) IsAction() bool

func (*Event) MarkError

func (e *Event) MarkError(err error) bool

type EventInstance

type EventInstance struct {
	ID         string
	Group      string
	Deployment string
	AZ         string
}

type EventInstanceResp

type EventInstanceResp struct {
	ID         string
	Group      string
	Deployment string
	AZ         string
}

type EventResponse

type EventResponse struct {
	ID   string
	Type string

	Instance EventInstanceResp

	ExecutionStartedAt   string
	ExecutionCompletedAt string

	Error string
	// contains filtered or unexported fields
}

func NewEventResponse

func NewEventResponse(event *Event) EventResponse

func (EventResponse) DescriptionHTML

func (r EventResponse) DescriptionHTML() template.HTML

func (EventResponse) IsAction

func (r EventResponse) IsAction() bool

type EventResult

type EventResult struct {
	Event *Event
	Error error
}

type Events

type Events struct {
	// contains filtered or unexported fields
}

func NewEvents

func NewEvents(uuidGen boshuuid.Generator, reporter Reporter, incidentID string, logger boshlog.Logger) *Events

func (*Events) Add

func (e *Events) Add(event Event) *Event

func (*Events) Events

func (e *Events) Events() []*Event

func (*Events) FirstError

func (e *Events) FirstError() error

func (*Events) RegisterResult

func (e *Events) RegisterResult(r EventResult)

func (*Events) Results

func (e *Events) Results() chan EventResult

type Incident

type Incident interface {
	ID() string

	TaskTypes() []string
	ShortDescription() (string, error)

	Events() *Events

	ExecutionStartedAt() time.Time
	ExecutionCompletedAt() time.Time
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(logger boshlog.Logger) Logger

func (Logger) ReportEventExecutionCompletion

func (r Logger) ReportEventExecutionCompletion(incidentID string, e Event)

func (Logger) ReportEventExecutionStart

func (r Logger) ReportEventExecutionStart(incidentID string, e Event)

func (Logger) ReportIncidentExecutionCompletion

func (r Logger) ReportIncidentExecutionCompletion(i Incident)

func (Logger) ReportIncidentExecutionStart

func (r Logger) ReportIncidentExecutionStart(i Incident)

type Reporter

type Reporter interface {
	ReportIncidentExecutionStart(Incident)
	ReportIncidentExecutionCompletion(Incident)

	ReportEventExecutionStart(string, Event)
	ReportEventExecutionCompletion(string, Event)
}

Jump to

Keyboard shortcuts

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