internal

package
v0.0.0-...-de8e732 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoUpstream     = errors.New("upstream cannot be empty")
	ErrAPIKeysToShort = errors.New("API keys must be at least 16 characters long")
	RegexSplit        = regexp.MustCompile(`[,\s]+`)
)

Functions

func Main

func Main()

Types

type Config

type Config struct {
	LogLevel string `json:"log_level" yaml:"log_level" mapstructure:"log_level"`
	Upstream string `json:"upstream" yaml:"upstream" mapstructure:"upstream"`

	HTTPServer     *httpserver.Config     `json:"http_server" yaml:"http_server" mapstructure:"http_server"`
	Authentication *authentication.Config `json:"authentication" yaml:"authentication" mapstructure:"authentication"`
	RateLimit      *ratelimit.Config      `json:"rate_limit" yaml:"rate_limit" mapstructure:"rate_limit"`
	// contains filtered or unexported fields
}

Config defines the essential parameters for serving this application.

func NewConfig

func NewConfig() *Config

NewConfig creates and returns a new Config having default values from the given configuration file.

func (*Config) GetUpstream

func (r *Config) GetUpstream() *url.URL

func (*Config) Validate

func (r *Config) Validate() error

Validate ensures the all necessary configurations are filled and within valid confines. Any misconfiguration results in well-defined standardized errors.

Jump to

Keyboard shortcuts

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