Documentation
¶
Overview ¶
Package config provides configuration management for the firelynx server.
Package config provides domain model for server configuration
Index ¶
Constants ¶
const ( // VersionLatest is the latest supported configuration version VersionLatest = version.Version // VersionUnknown is used when a version is not specified VersionUnknown = "unknown" )
Configuration version constants
Variables ¶
var ( // Top-level error categories ErrFailedToLoadConfig = errz.ErrFailedToLoadConfig ErrFailedToConvertConfig = errz.ErrFailedToConvertConfig ErrFailedToValidateConfig = errz.ErrFailedToValidateConfig ErrUnsupportedConfigVer = errz.ErrUnsupportedConfigVer // Validation specific errors ErrDuplicateID = errz.ErrDuplicateID ErrEmptyID = errz.ErrEmptyID ErrInvalidReference = errz.ErrInvalidReference ErrMissingRequiredField = errz.ErrMissingRequiredField ErrRouteConflict = errz.ErrRouteConflict // Type specific errors ErrInvalidListenerType = errz.ErrInvalidListenerType ErrInvalidRouteType = errz.ErrInvalidRouteType ErrRouteTypeMismatch = errz.ErrRouteTypeMismatch ErrInvalidAppType = errz.ErrInvalidAppType ErrInvalidEvaluator = errz.ErrInvalidEvaluator // Reference specific errors ErrListenerNotFound = errz.ErrListenerNotFound ErrAppNotFound = errz.ErrAppNotFound ErrEndpointNotFound = errz.ErrEndpointNotFound ErrRouteNotFound = errz.ErrRouteNotFound )
Re-export errors for backward compatibility and convenience
Functions ¶
func ConfigTree ¶
ConfigTree converts a Config struct into a rendered tree string
Types ¶
type Config ¶
type Config struct {
Version string
Listeners listeners.ListenerCollection
Endpoints endpoints.EndpointCollection
Apps *apps.AppCollection
// ValidationCompleted is set after the config has been validated. If the config is invalid, this will still be true.
ValidationCompleted bool
// contains filtered or unexported fields
}
Config represents the complete server configuration
func NewConfig ¶
NewConfig loads configuration from a TOML file path, converts it to the domain model. It does NOT validate the config.
func NewConfigFromBytes ¶
NewConfigFromBytes loads configuration from TOML bytes, converts it to the domain model. It does NOT validate the config.
func NewConfigFromReader ¶
NewConfigFromReader loads configuration from an io.Reader providing TOML data, converts it to the domain model. It does NOT validate the config.
func NewFromProto ¶
func NewFromProto(pbConfig *pb.ServerConfig) (*Config, error)
NewFromProto creates a domain Config from a protobuf ServerConfig. This is the recommended function for converting from protobuf to domain model as it handles defaults and error collection. It does NOT validate the config.
func (*Config) ToProto ¶
func (c *Config) ToProto() *pb.ServerConfig
ToProto converts the domain Config to a protobuf ServerConfig
type Validatable ¶
type Validatable interface {
// Validate performs validation on the object and returns an error if validation fails.
// The error should contain specific information about what validation checks failed.
// If multiple validations fail, all errors should be combined using errors.Join().
Validate() error
}
Validatable defines an interface for objects that can validate themselves. Any struct that implements this interface can be validated as part of a validation chain.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apps provides types and functionality for application configuration in the firelynx server.
|
Package apps provides types and functionality for application configuration in the firelynx server. |
|
composite
Package composite provides types and utilities for composite script applications in firelynx.
|
Package composite provides types and utilities for composite script applications in firelynx. |
|
echo
Package echo provides app-specific configurations for the firelynx server.
|
Package echo provides app-specific configurations for the firelynx server. |
|
mcp
Package mcp provides types and utilities for MCP-based applications in firelynx.
|
Package mcp provides types and utilities for MCP-based applications in firelynx. |
|
scripts
Package scripts provides types and utilities for script-based applications in firelynx.
|
Package scripts provides types and utilities for script-based applications in firelynx. |
|
scripts/evaluators
Package evaluators provides types and utilities for various script evaluators used in firelynx.
|
Package evaluators provides types and utilities for various script evaluators used in firelynx. |
|
Package endpoints provides configuration types and utilities for routing in the firelynx server.
|
Package endpoints provides configuration types and utilities for routing in the firelynx server. |
|
middleware
Package middleware provides types and functionality for middleware configuration in the firelynx server.
|
Package middleware provides types and functionality for middleware configuration in the firelynx server. |
|
routes
Package routes provides configuration types and utilities for request routing in the firelynx server.
|
Package routes provides configuration types and utilities for request routing in the firelynx server. |
|
Package errz provides shared error definitions for the config package and its subpackages.
|
Package errz provides shared error definitions for the config package and its subpackages. |
|
Package listeners provides configuration types and utilities for network listeners in the firelynx server.
|
Package listeners provides configuration types and utilities for network listeners in the firelynx server. |
|
toml
Package toml provides TOML configuration loading with protobuf post-processing.
|
Package toml provides TOML configuration loading with protobuf post-processing. |
|
Package staticdata provides types and utilities for handling static data that can be passed to apps and routes in firelynx.
|
Package staticdata provides types and utilities for handling static data that can be passed to apps and routes in firelynx. |
|
TODO: change the param order, standardize on a metadata struct
|
TODO: change the param order, standardize on a metadata struct |
|
finitestate
Configuration saga state machine implementation.
|
Configuration saga state machine implementation. |
|
Package validation provides validation utilities for domain config types.
|
Package validation provides validation utilities for domain config types. |