eventapi

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventReceiver

type EventReceiver struct {
	// Events is the channel used by the event API handler to send JobEvents
	// back to the runner, or whatever code is using this receiver.
	Events chan JobEvent

	// SocketPath is the path on the filesystem to a unix streaming socket
	SocketPath string

	// URLPath is the path portion of the url at which events should be
	// received. For example, "/events/"
	URLPath string
	// contains filtered or unexported fields
}

EventReceiver serves the event API

func New

func New(ident string, errChan chan<- error) (*EventReceiver, error)

func (*EventReceiver) Close

func (e *EventReceiver) Close()

Close ensures that appropriate resources are cleaned up, such as any unix streaming socket that may be in use. Close must be called.

type EventTime

type EventTime struct {
	time.Time
}

EventTime - time to unmarshal nano time.

func (EventTime) MarshalJSON

func (e EventTime) MarshalJSON() ([]byte, error)

MarshalJSON - override the marshal json.

func (*EventTime) UnmarshalJSON

func (e *EventTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON - override unmarshal json.

type JobEvent

type JobEvent struct {
	UUID      string                 `json:"uuid"`
	Counter   int                    `json:"counter"`
	StdOut    string                 `json:"stdout"`
	StartLine int                    `json:"start_line"`
	EndLine   int                    `json:"EndLine"`
	Event     string                 `json:"event"`
	EventData map[string]interface{} `json:"event_data"`
	PID       int                    `json:"pid"`
	Created   EventTime              `json:"created"`
}

JobEvent - event of an ansible run.

type StatsEventData

type StatsEventData struct {
	Playbook     string         `json:"playbook"`
	PlaybookUUID string         `json:"playbook_uuid"`
	Changed      map[string]int `json:"changed"`
	Ok           map[string]int `json:"ok"`
	Failures     map[string]int `json:"failures"`
	Skipped      map[string]int `json:"skipped"`
}

StatsEventData - data for a the status event.

type StatusJobEvent

type StatusJobEvent struct {
	UUID      string         `json:"uuid"`
	Counter   int            `json:"counter"`
	StdOut    string         `json:"stdout"`
	StartLine int            `json:"start_line"`
	EndLine   int            `json:"EndLine"`
	Event     string         `json:"event"`
	EventData StatsEventData `json:"event_data"`
	PID       int            `json:"pid"`
	Created   EventTime      `json:"created"`
}

StatusJobEvent - event of an ansible run.

Jump to

Keyboard shortcuts

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