config

package
v0.0.0-...-ecc870c Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxReqBodySize = 4 * 1024 * 1024

DefaultMaxReqBodySize defines the default maximum request body size in bytes.

View Source
const IDValidCharDict = "abcdefghijklmnopqrstuvwxyz" +
	"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
	"0123456789" +
	"_-"
View Source
const MinReqBodySize = 256

MinReqBodySize defines the minimum accepted value for `max-request-body-size` in bytes.

Variables

View Source
var ConfigFileExtension = regexp.MustCompile(`\.(yml|yaml)$`)
View Source
var ErrPathNotAbsolute = errors.New("path is not starting with /")
View Source
var ErrURLNoHost = errors.New("host is not defined")
View Source
var ErrURLProtocolProblem = errors.New("protocol is not supported or undefined")
View Source
var TemplateFileExtension = regexp.MustCompile(`\.gqt$`)
View Source
var ValidProtocolSchemes = []string{"http", "https"}

Functions

func ValidateID

func ValidateID(n string) (err string)

Types

type APIServerConfig

type APIServerConfig struct {
	Host string
	TLS  TLS
}

type Config

type Config struct {
	Proxy           ProxyServerConfig
	API             *APIServerConfig
	Services        *hamap.Map[[]byte, *Service]
	ServicesEnabled []*Service
}

func New

func New(path string) (c *Config, err error)

func (*Config) Equal

func (c *Config) Equal(d *Config) bool

type ErrorAlien

type ErrorAlien struct {
	Items []string
}

func (ErrorAlien) Error

func (e ErrorAlien) Error() string

type ErrorDuplicate

type ErrorDuplicate struct {
	Original  string
	Duplicate string
}

func (ErrorDuplicate) Error

func (e ErrorDuplicate) Error() string

type ErrorIllegal

type ErrorIllegal struct {
	FilePath string
	Feature  string
	Message  string
}

func (ErrorIllegal) Error

func (e ErrorIllegal) Error() string

type ErrorMissing

type ErrorMissing struct {
	FilePath string
	Feature  string
}

func (ErrorMissing) Error

func (e ErrorMissing) Error() string

type ProxyServerConfig

type ProxyServerConfig struct {
	Host                string
	TLS                 TLS
	MaxReqBodySizeBytes int
}

type Service

type Service struct {
	ID               string
	Path             string
	ForwardURL       string
	Templates        *hamap.Map[[]byte, *Template]
	TemplatesEnabled []*Template
	ForwardReduced   bool
	Enabled          bool
	FilePath         string
}

func (*Service) Equal

func (c *Service) Equal(d *Service) bool

type TLS

type TLS struct {
	CertFile string
	KeyFile  string
}

type Template

type Template struct {
	ID       string
	Source   []byte
	Document gqt.Doc
	Name     string
	Tags     []string
	Enabled  bool
	FilePath string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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