cloudevents

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Name     string         `json:"name" validate:"required"`
	Disabled bool           `json:"disabled"`
	Protocol string         `json:"protocol" validate:"required_if=Enabled true,oneof=file http"`
	Target   string         `json:"target" validate:"required_if=Enabled true"`
	Options  map[string]any `json:"options,omitempty"`
	// contains filtered or unexported fields
}

type Events

type Events struct {
	Clients []*ClientConfig `json:"clients" validate:"dive"`
	// contains filtered or unexported fields
}

func Load

func Load(path string, validator *utils.Validator, workflow *model.Workflow) (*Events, error)

func (*Events) Emit

func (e *Events) Emit(ctx context.Context, eventType string, opts ...Option)

type FileSender

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

FileSender implements protocol.Sender to write CloudEvents to files.

func NewFileSender

func NewFileSender(targetDir string) (*FileSender, error)

NewFileSender creates a new FileSender that writes events to the specified directory.

func (*FileSender) Send

func (s *FileSender) Send(ctx context.Context, m binding.Message, transformers ...binding.Transformer) error

Send writes the CloudEvent to a file named after the event ID. If the file already exists, the event is appended to the file.

type Option

type Option func(*sdk.Event)

func WithEvent

func WithEvent(f func(*sdk.Event)) Option

Jump to

Keyboard shortcuts

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