broker

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAttributesNames

func ValidateAttributesNames(attrs map[string]string) (errs *apis.FieldError)

func ValidateOneOf

func ValidateOneOf(filter *Filter) (err *apis.FieldError)

func ValidateSubscriptionAPIFilter

func ValidateSubscriptionAPIFilter(ctx context.Context, filter *Filter) (errs *apis.FieldError)

func ValidateSubscriptionAPIFiltersList

func ValidateSubscriptionAPIFiltersList(ctx context.Context, filters []Filter) (errs *apis.FieldError)

Types

type BackoffPolicyType

type BackoffPolicyType string
const (
	BackoffPolicyConstant    BackoffPolicyType = "constant"
	BackoffPolicyLinear      BackoffPolicyType = "linear"
	BackoffPolicyExponential BackoffPolicyType = "exponential"
)

type Bounds added in v1.4.0

type Bounds struct {
	Start *string `json:"start"`
	End   *string `json:"end"`
}

Bounds applied to the trigger that mark the initial and final item to be sent from the broker.

func (*Bounds) GetEnd added in v1.4.0

func (b *Bounds) GetEnd() string

func (*Bounds) GetStart added in v1.4.0

func (b *Bounds) GetStart() string

type Config

type Config struct {
	Ingest   *Ingest            `json:"ingest,omitempty"`
	Triggers map[string]Trigger `json:"triggers"`
}

func Parse

func Parse(config string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate(ctx context.Context) *apis.FieldError

type DeliveryOptions

type DeliveryOptions struct {
	Retry         *int32             `json:"retry,omitempty"`
	BackoffPolicy *BackoffPolicyType `json:"backoffPolicy,omitempty"`

	// BackoffDelay is the delay before retrying.
	// More information on Duration format:
	//  - https://www.iso.org/iso-8601-date-and-time-format.html
	//  - https://en.wikipedia.org/wiki/ISO_8601
	BackoffDelay  *string `json:"backoffDelay,omitempty"`
	DeadLetterURL *string `json:"deadLetterURL,omitempty"`
}

func (*DeliveryOptions) Validate

func (d *DeliveryOptions) Validate(ctx context.Context) (errs *apis.FieldError)

type Filter

type Filter struct {
	// All evaluates to true if all the nested expressions evaluate to true.
	// It must contain at least one filter expression.
	//
	// +optional
	All []Filter `json:"all,omitempty"`

	// Any evaluates to true if at least one of the nested expressions evaluates
	// to true. It must contain at least one filter expression.
	//
	// +optional
	Any []Filter `json:"any,omitempty"`

	// Not evaluates to true if the nested expression evaluates to false.
	//
	// +optional
	Not *Filter `json:"not,omitempty"`

	// Exact evaluates to true if the value of the matching CloudEvents
	// attribute matches exactly the String value specified (case-sensitive).
	// Exact must contain exactly one property, where the key is the name of the
	// CloudEvents attribute to be matched, and its value is the String value to
	// use in the comparison. The attribute name and value specified in the filter
	// expression cannot be empty strings.
	//
	// +optional
	Exact map[string]string `json:"exact,omitempty"`

	// Prefix evaluates to true if the value of the matching CloudEvents
	// attribute starts with the String value specified (case-sensitive). Prefix
	// must contain exactly one property, where the key is the name of the
	// CloudEvents attribute to be matched, and its value is the String value to
	// use in the comparison. The attribute name and value specified in the filter
	// expression cannot be empty strings.
	//
	// +optional
	Prefix map[string]string `json:"prefix,omitempty"`

	// Suffix evaluates to true if the value of the matching CloudEvents
	// attribute ends with the String value specified (case-sensitive). Suffix
	// must contain exactly one property, where the key is the name of the
	// CloudEvents attribute to be matched, and its value is the String value to
	// use in the comparison. The attribute name and value specified in the filter
	// expression cannot be empty strings.
	//
	// +optional
	Suffix map[string]string `json:"suffix,omitempty"`
}

func (*Filter) DeepCopy

func (in *Filter) DeepCopy() *Filter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter.

func (*Filter) DeepCopyInto

func (in *Filter) DeepCopyInto(out *Filter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Ingest

type Ingest struct {
	User     string `json:"user"`
	Password string `json:"password"`
}

func (*Ingest) Validate

func (i *Ingest) Validate(ctx context.Context) *apis.FieldError

type Target

type Target struct {
	URL *string `json:"url,,omitempty"`
	// Deprecated, use the trigger's Delivery options instead.
	DeliveryOptions *DeliveryOptions `json:"deliveryOptions,omitempty"`
}

func (*Target) Validate

func (i *Target) Validate(ctx context.Context) (errs *apis.FieldError)

type Trigger

type Trigger struct {
	Filters         []Filter         `json:"filters,omitempty"`
	Target          Target           `json:"target"`
	DeliveryOptions *DeliveryOptions `json:"deliveryOptions,omitempty"`
	Bounds          *TriggerBounds   `json:"bounds,omitempty"`
}

func (*Trigger) GetDeliveryOptions added in v1.4.0

func (t *Trigger) GetDeliveryOptions() *DeliveryOptions

HACK temporary to make the Delivery options move smooth, remove this once Target does not host the deliver options.

func (*Trigger) Validate

func (t *Trigger) Validate(ctx context.Context) *apis.FieldError

type TriggerBounds added in v1.4.0

type TriggerBounds struct {
	ByID   *Bounds `json:"byId,omitempty"`
	ByDate *Bounds `json:"byDate,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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