routes

package
v0.0.0-...-726e4b6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PreProcessor

type PreProcessor struct {
	Type      string   `yaml:"type"`
	Delimiter string   `yaml:"delimiter"`
	TrimSpace bool     `yaml:"trimspace"`
	Fields    []string `yaml:"fields"`
	// contains filtered or unexported fields
}

type Route

type Route struct {
	Name         string        `yaml:"name"`
	Disable      bool          `yaml:"disable"`
	Topics       []string      `yaml:"topics"`
	Skip         bool          `yaml:"skip"`
	Template     Template      `yaml:"template"`
	PreProcessor *PreProcessor `yaml:"preprocessor,omitempty"`
}

func (*Route) DisplayTopics

func (r *Route) DisplayTopics(sep ...string) string

func (*Route) ExecutePreprocessor

func (r *Route) ExecutePreprocessor(in string) (string, error)

func (*Route) HasPreprocessor

func (r *Route) HasPreprocessor() bool

func (*Route) Match

func (r *Route) Match(topic string) bool

match takes the topic string of the published message and does a basic compare to the string of the current Route, if they match it returns true

func (*Route) PreparePreProcessor

func (r *Route) PreparePreProcessor() error

type Specification

type Specification struct {
	Disable bool    `yaml:"disable"`
	Routes  []Route `yaml:"routes"`
}

func Parse

func Parse(r io.Reader) (*Specification, error)

type Template

type Template struct {
	Type  string `yaml:"type"`
	Value string `yaml:"value"`
	Path  string `yaml:"path"`
}

type VariableFields

type VariableFields struct {
	Fields []string `yaml:"fields"`
}

Jump to

Keyboard shortcuts

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