payload

package
v0.0.0-...-6d10cd0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Input string
	Type  string
	ID    string
	Data  interface{}
}

Event input event structure

type EventInfo

type EventInfo struct {
	Input string `yaml:"input" json:"input"`
	Type  string `yaml:"type" json:"type"`
}

EventInfo describes event information data

type Payload

type Payload struct {
	Event  *EventInfo             `yaml:"event" json:"event"`
	Env    map[string]interface{} `yaml:"env" json:"env"`
	Vars   map[string]interface{} `yaml:"vars" json:"vars"`
	Req    interface{}            `yaml:"req" json:"req"`
	Resp   map[string]interface{} `yaml:"resp" json:"resp"`
	Export map[string]interface{} `yaml:"export" json:"export"`
	Match  map[string]interface{} `yaml:"match" json:"match"`
}

Payload is the struct with all context sequences

func (*Payload) ExportField

func (p *Payload) ExportField(ctx context.Context, current string, new string)

ExportField adds specified field to export map

func (*Payload) FromJSON

func (p *Payload) FromJSON(ctx context.Context, data []byte) *Payload

FromJSON converts binary JSON data to Payload

func (*Payload) QueryField

func (p *Payload) QueryField(ctx context.Context, query string) interface{}

QueryField gets data from specified field in payload

func (*Payload) SetField

func (p *Payload) SetField(ctx context.Context, query string, data interface{})

SetField sets specified field with data in payload

func (*Payload) ToJSON

func (p *Payload) ToJSON(ctx context.Context) []byte

ToJSON converts Payload to binary JSON data

type Response

type Response struct {
	// ID of original request
	ID string
	// Output where to send response
	Output string
	// Data response data
	Data map[string]interface{}
	// Request original request
	Request *Event
}

Response output response structure

Jump to

Keyboard shortcuts

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