Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateConfig ¶ added in v0.6.0
ValidateConfig checks that a config is within safe bounds and uses valid values.
Types ¶
type Config ¶
type Config struct {
Routes []Route `yaml:"routes"`
Settings SettingsConfig `yaml:"settings"`
}
Config represents the top-level .webex-agents.yml file.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a config with sensible defaults and no routes.
func LoadConfig ¶
LoadConfig reads and parses a .webex-agents.yml file.
type InboundMessage ¶
InboundMessage contains the fields needed for route matching.
type MatchCondition ¶
type MatchCondition struct {
Space string `yaml:"space,omitempty"`
Keywords []string `yaml:"keywords,omitempty"`
Direct bool `yaml:"direct,omitempty"`
}
MatchCondition defines how an inbound message is matched to a route.
type Route ¶
type Route struct {
Match MatchCondition `yaml:"match"`
Agent string `yaml:"agent"`
Priority string `yaml:"priority"`
}
Route maps a match condition to an agent with priority.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router evaluates inbound messages against the route config.
func (*Router) Route ¶
func (r *Router) Route(msg InboundMessage) *RoutingResult
Route evaluates the message against routes top-to-bottom. First match wins. Returns nil if no route matches.
type RoutingResult ¶
RoutingResult holds the outcome of routing a message.
type SettingsConfig ¶
type SettingsConfig struct {
BufferSize int `yaml:"buffer_size"`
CheckInterval string `yaml:"check_interval"`
PriorityLevels []string `yaml:"priority_levels"`
}
SettingsConfig holds global routing settings.