config

package
v0.0.0-...-fd23a95 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPath = "examples/config.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server `yaml:"server"`
	Routes map[string]*Route `yaml:"routes"`
	// NOTE: Why not RWMutex?
	sync.Mutex
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

func (*Config) Watch

func (c *Config) Watch(logger *slog.Logger) error

type Route

type Route struct {
	Upstreams          []string                    `yaml:"upstreams"`
	LoadBalancerPolicy balancer.LoadBalancerPolicy `yaml:"lb_policy"`
	// FIXME: Currently doesn't seem to be possible to unmarshal directly into a slice of MiddlewareInternalRepr
	MiddlewareInternalRepr map[middleware.MiddlewareType]interface{} `yaml:"middleware"`
	// contains filtered or unexported fields
}

func (*Route) Middleware

func (r *Route) Middleware() []middleware.Middleware

FIXME: Temporary solution for testing purposes

type Server

type Server struct {
	Address            string `yaml:"address"`
	ReadTimeoutSeconds uint   `yaml:"read_timeout"`
}

Jump to

Keyboard shortcuts

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