router

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "router"
	InPort        = "input"
	DefaultPort   = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

func (*Component) GetInfo

func (t *Component) GetInfo() module.ComponentInfo

func (*Component) Handle

func (t *Component) Handle(ctx context.Context, handler module.Handler, port string, msg interface{}) error

func (*Component) Instance

func (t *Component) Instance() module.Component

func (*Component) Ports

func (t *Component) Ports() []module.Port

Ports drop settings, make it port payload

type Condition

type Condition struct {
	RouteName RouteName `json:"route" title:"Route" required:"true"`
	Condition bool      `json:"condition" required:"true" title:"Condition"`
}

type Context

type Context any

type InMessage

type InMessage struct {
	Context    Context     `json:"context" configurable:"true" required:"true" title:"Context" description:"Arbitrary message to be routed"`
	Conditions []Condition `json:"conditions" required:"true" title:"Conditions" minItems:"1" uniqueItems:"true"`
}

type RouteName

type RouteName struct {
	Value   string
	Options []string
}

RouteName special type which can carry its value and possible options for enum values

func (*RouteName) JSONSchema

func (r *RouteName) JSONSchema() (jsonschema.Schema, error)

func (*RouteName) MarshalJSON

func (r *RouteName) MarshalJSON() ([]byte, error)

MarshalJSON treat like underlying Value string

func (*RouteName) UnmarshalJSON

func (r *RouteName) UnmarshalJSON(data []byte) error

UnmarshalJSON treat like underlying Value string

type Settings

type Settings struct {
	Routes            []string `json:"routes" required:"true" title:"Routes" minItems:"1" uniqueItems:"true"`
	EnableDefaultPort bool     `json:"enableDefaultPort" required:"true" title:"Enable default port"`
}

Jump to

Keyboard shortcuts

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