config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveryConfig

type DiscoveryConfig struct {
	Type   string                 `yaml:"type"`
	Config map[string]interface{} `yaml:"config"`
}

type DiscoveryRef

type DiscoveryRef struct {
	Type   string            `yaml:"type"`
	Params map[string]string `yaml:"params,omitempty"`
}

type Dynamic

type Dynamic struct {
	Routes      []RouteConfig       `yaml:"routes"`
	Upstreams   []UpstreamConfig    `yaml:"upstreams,omitempty"`
	Plugins     []PluginConfig      `yaml:"plugins,omitempty"`
	StreamRoute []StreamRouteConfig `yaml:"streamRoutes,omitempty"`
}

type DynamicValidator

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

TODO: Make dynamic validation's validator registerable by each component (e.g., plugins, discovery, etc.). (maybe jsonschema validation?)

func NewDynamicValidator

func NewDynamicValidator() *DynamicValidator

func (*DynamicValidator) GetErrors

func (v *DynamicValidator) GetErrors() []ValidationError

func (*DynamicValidator) HasErrors

func (v *DynamicValidator) HasErrors() bool

func (*DynamicValidator) ToError

func (v *DynamicValidator) ToError() error

func (*DynamicValidator) Validate

func (v *DynamicValidator) Validate(cfg *Dynamic) error

type ListenerConfig

type ListenerConfig struct {
	Name  string     `yaml:"name"`
	Port  int        `yaml:"port"`
	TLS   *TLSConfig `yaml:"tls,omitempty"`
	HTTP2 bool       `yaml:"http2,omitempty"`
}

type Match

type Match struct {
	Path    string            `yaml:"path,omitempty"`
	Headers map[string]string `yaml:"headers,omitempty"`
	Method  string            `yaml:"method,omitempty"`
}

type Node

type Node struct {
	URL string `yaml:"url"`
}

type PluginConfig

type PluginConfig struct {
	Name   string           `yaml:"name"`
	Type   string           `yaml:"type"`
	Config types.PluginConf `yaml:"config"`
}

type ProviderConfig

type ProviderConfig struct {
	Name   string                 `yaml:"name"`
	Type   string                 `yaml:"type"`
	Config map[string]interface{} `yaml:"config"`
}

type RouteConfig

type RouteConfig struct {
	Name     string          `yaml:"name"`
	Listener string          `yaml:"listener"`
	Matches  []Match         `yaml:"matches"`
	Plugins  []PluginConfig  `yaml:"plugins,omitempty"`
	Upstream *UpstreamConfig `yaml:"upstream,omitempty"`
}

type Static

type Static struct {
	Listeners        []ListenerConfig  `yaml:"listeners"`
	Providers        []ProviderConfig  `yaml:"providers"`
	DiscoveryConfigs []DiscoveryConfig `yaml:"discovery"`
	LogLevel         string            `yaml:"log_level"`
}

type StaticValidator

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

func NewStaticValidator

func NewStaticValidator() *StaticValidator

func (*StaticValidator) GetErrors

func (v *StaticValidator) GetErrors() []ValidationError

func (*StaticValidator) HasErrors

func (v *StaticValidator) HasErrors() bool

func (*StaticValidator) ToError

func (v *StaticValidator) ToError() error

func (*StaticValidator) Validate

func (v *StaticValidator) Validate(cfg *Static) error

Validate performs all validation checks on the static configuration

type StreamRouteConfig

type StreamRouteConfig struct {
	Name     string          `yaml:"name"`
	Listener string          `yaml:"listener"`
	Plugins  []PluginConfig  `yaml:"plugins,omitempty"`
	Upstream *UpstreamConfig `yaml:"upstream,omitempty"`
}

type TLSConfig

type TLSConfig struct {
	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`
}

type UpstreamConfig

type UpstreamConfig struct {
	Name      string       `yaml:"name"`
	Type      string       `yaml:"type"`
	Nodes     []Node       `yaml:"nodes,omitempty"`
	Service   string       `yaml:"service,omitempty"`
	Discovery DiscoveryRef `yaml:"discovery,omitempty"`
}

type ValidationError

type ValidationError struct {
	Field   string `json:"field,omitempty"`
	Message string `json:"message"`
}

ValidationError represents a configuration validation error

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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