configuration

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LocationInBox = `goxr-server.yaml`

Variables

This section is empty.

Functions

This section is empty.

Types

type Catchall

type Catchall struct {
	Target   *string   `yaml:"target,omitempty"`
	Includes *[]string `yaml:"includes,omitempty"`
	Excludes *[]string `yaml:"excludes,omitempty"`
	// contains filtered or unexported fields
}

func (*Catchall) Flags added in v0.2.0

func (instance *Catchall) Flags() []cli.Flag

func (Catchall) GetExcludes

func (instance Catchall) GetExcludes() []string

func (Catchall) GetIncludes

func (instance Catchall) GetIncludes() []string

func (Catchall) GetTarget

func (instance Catchall) GetTarget() string

func (*Catchall) IsEligible

func (instance *Catchall) IsEligible(candidate string) (bool, error)

func (Catchall) Merge added in v0.2.0

func (instance Catchall) Merge(with Catchall) Catchall

func (*Catchall) Validate

func (instance *Catchall) Validate(using goxr.Box) (errors []error)

type Configuration

type Configuration struct {
	Listen   Listen   `yaml:"listen,omitempty"`
	Paths    Paths    `yaml:"paths,omitempty"`
	Response Response `yaml:"response,omitempty"`
	Logging  Logging  `yaml:"logging,omitempty"`
}

func OfBox

func OfBox(box goxr.Box) (c Configuration, rErr error)

func Read

func Read(reader io.Reader) (c Configuration, err error)

func (*Configuration) Flags added in v0.2.0

func (instance *Configuration) Flags() (result []cli.Flag)

func (Configuration) Merge added in v0.2.0

func (instance Configuration) Merge(with Configuration) (result Configuration)

func (*Configuration) Validate

func (instance *Configuration) Validate(using goxr.Box) (errors []error)

func (*Configuration) ValidateAndSummarize

func (instance *Configuration) ValidateAndSummarize(using goxr.Box) error

type HttpAddress added in v0.2.0

type HttpAddress string

func (*HttpAddress) Set added in v0.2.0

func (instance *HttpAddress) Set(plain string) error

func (HttpAddress) String added in v0.2.0

func (instance HttpAddress) String() string

type Listen

type Listen struct {
	HttpAddress HttpAddress `yaml:"httpAddress,omitempty"`
}

func (*Listen) Flags added in v0.2.0

func (instance *Listen) Flags() []cli.Flag

func (Listen) GetHttpAddress

func (instance Listen) GetHttpAddress() string

func (Listen) Merge added in v0.2.0

func (instance Listen) Merge(with Listen) Listen

func (*Listen) Validate

func (instance *Listen) Validate(using goxr.Box) (errors []error)

type Logging

type Logging struct {
	AccessLog *bool `yaml:"accessLog,omitempty"`
}

func (*Logging) Flags added in v0.2.0

func (instance *Logging) Flags() []cli.Flag

func (Logging) GetAccessLog

func (instance Logging) GetAccessLog() bool

func (Logging) Merge added in v0.2.0

func (instance Logging) Merge(with Logging) Logging

func (*Logging) Validate

func (instance *Logging) Validate(goxr.Box) (errors []error)

type Paths

type Paths struct {
	Catchall    Catchall       `yaml:"catchall,omitempty"`
	Index       *string        `yaml:"index,omitempty"`
	StatusCodes map[int]string `yaml:"statusCodes,omitempty"`
	Includes    *[]string      `yaml:"includes,omitempty"`
	Excludes    *[]string      `yaml:"excludes,omitempty"`
	// contains filtered or unexported fields
}

func (*Paths) FindStatusCode

func (instance *Paths) FindStatusCode(code int) string

func (*Paths) Flags added in v0.2.0

func (instance *Paths) Flags() []cli.Flag

func (Paths) GetExcludes

func (instance Paths) GetExcludes() []string

func (Paths) GetIncludes

func (instance Paths) GetIncludes() []string

func (Paths) GetIndex

func (instance Paths) GetIndex() string

func (Paths) GetStatusCodes

func (instance Paths) GetStatusCodes() map[int]string

func (Paths) Merge added in v0.2.0

func (instance Paths) Merge(with Paths) Paths

func (*Paths) PathAllowed

func (instance *Paths) PathAllowed(candidate string) (bool, error)

func (*Paths) Validate

func (instance *Paths) Validate(using goxr.Box) (errors []error)

type Response

type Response struct {
	MimeTypes        map[string]string   `yaml:"mimeTypes,omitempty"`
	Gzip             *bool               `yaml:"gzip,omitempty"`
	Headers          map[string][]string `yaml:"headers,omitempty"`
	WithEtag         *bool               `yaml:"withEtag,omitempty"`
	WithLastModified *bool               `yaml:"withLastModified,omitempty"`
	WithContentType  *bool               `yaml:"withContentType,omitempty"`
}

func (*Response) Flags added in v0.2.0

func (instance *Response) Flags() []cli.Flag

func (Response) GetGzip

func (instance Response) GetGzip() bool

func (Response) GetHeaders

func (instance Response) GetHeaders() map[string][]string

func (Response) GetMimeTypes

func (instance Response) GetMimeTypes() map[string]string

func (Response) GetWithContentType added in v0.1.0

func (instance Response) GetWithContentType() bool

func (Response) GetWithEtag added in v0.1.0

func (instance Response) GetWithEtag() bool

func (Response) GetWithLastModified added in v0.1.0

func (instance Response) GetWithLastModified() bool

func (Response) Merge added in v0.2.0

func (instance Response) Merge(with Response) Response

func (*Response) Validate

func (instance *Response) Validate(using goxr.Box) (errors []error)

Jump to

Keyboard shortcuts

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