events

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEvent

func ParseEvent(message map[string]interface{}, eventChan chan<- SaltEvent, keepRawBody bool)

Types

type EventData

type EventData struct {
	Arg       []interface{} `msgpack:"arg"`
	Cmd       string        `msgpack:"cmd"`
	Fun       string        `msgpack:"fun"`
	FunArgs   []interface{} `msgpack:"fun_args"`
	Id        string        `msgpack:"id"`
	Jid       string        `msgpack:"jid"`
	JidStamp  string        `msgpack:"jid_stamp"`
	Minions   []string      `msgpack:"minions"`
	Missing   []string      `msgpack:"missing"`
	Out       string        `msgpack:"out"`
	Retcode   int           `msgpack:"retcode"`
	Return    interface{}   `msgpack:"return"`
	Tgt       interface{}   `msgpack:"tgt"`
	TgtType   string        `msgpack:"tgt_type"`
	Timestamp string        `msgpack:"_stamp"`
	User      string        `msgpack:"user"`
	Schedule  string        `msgpack:"schedule"`
	Success   bool          `msgpack:"success"`
}

type EventListener

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

func NewEventListener

func NewEventListener(ctx context.Context, eventChan chan SaltEvent) *EventListener

func (*EventListener) Close

func (e *EventListener) Close() error

func (*EventListener) ListenEvents

func (e *EventListener) ListenEvents(keepRawBody bool)

func (*EventListener) Open

func (e *EventListener) Open()

func (*EventListener) Reconnect

func (e *EventListener) Reconnect()

type SaltEvent

type SaltEvent struct {
	Tag           string
	Type          string
	TargetNumber  int
	Data          EventData
	IsScheduleJob bool
	RawBody       []byte
}

func (*SaltEvent) ExtractState

func (e *SaltEvent) ExtractState() string

Extract state info from event

func (SaltEvent) RawToJSON added in v0.3.0

func (e SaltEvent) RawToJSON(indent bool) ([]byte, error)

func (SaltEvent) RawToYAML added in v0.3.0

func (e SaltEvent) RawToYAML() ([]byte, error)

Jump to

Keyboard shortcuts

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