event

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DefaultMode    = ""
	BinaryMode     = "binary"
	StructuredMode = "structured"
)

Mode of encoding.

Variables

This section is empty.

Functions

func ToYaml

func ToYaml(event Event) ([]byte, error)

Types

type ContextAttributes

type ContextAttributes struct {
	SpecVersion string `yaml:"specversion,omitempty"`
	Type        string `yaml:"type,omitempty"`
	Time        string `yaml:"time,omitempty"`
	ID          string `yaml:"id,omitempty"`
	Source      string `yaml:"source,omitempty"`
	Subject     string `yaml:"subject,omitempty"`
	// SchemaURL replaced by DataSchema in 1.0
	SchemaURL  string `yaml:"schemaurl,omitempty"`
	DataSchema string `yaml:"dataschema,omitempty"`
	// DataContentEncoding removed in 1.0
	DataContentEncoding string     `yaml:"dataecontentncoding,omitempty"`
	DataContentType     string     `yaml:"datacontenttype,omitempty"`
	Extensions          Extensions `yaml:"Extensions,omitempty"`
}

type Event

type Event struct {
	Mode                string            `yaml:"Mode,omitempty"`
	Attributes          ContextAttributes `yaml:"ContextAttributes,omitempty"`
	TransportExtensions Extensions        `yaml:"TransportExtensions,omitempty"`
	Data                string            `yaml:"Data,omitempty"`
}

func FromYaml

func FromYaml(files string, recursive bool) ([]Event, error)

func (*Event) Get added in v0.4.0

func (e *Event) Get(key string) string

Get returns the value of the attribute or extension named `key`.

type Extensions

type Extensions map[string]string

type MutationFn

type MutationFn func(Event) (Event, error)

Jump to

Keyboard shortcuts

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