configuration

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 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) 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) 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) Validate

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

func (*Configuration) ValidateAndSummarize

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

type Listen

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

func (Listen) GetHttpAddress

func (instance Listen) GetHttpAddress() string

func (*Listen) Validate

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

type Logging

type Logging struct {
	AccessLog *bool         `yaml:"accessLog,omitempty"`
	Level     LoggingLevel  `yaml:"level,omitempty"`
	Format    LoggingFormat `yaml:"format,omitempty"`
}

func (Logging) GetAccessLog

func (instance Logging) GetAccessLog() bool

func (Logging) GetFormat added in v0.1.0

func (instance Logging) GetFormat() log.Format

func (Logging) GetLevel

func (instance Logging) GetLevel() log.Level

func (*Logging) Validate

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

type LoggingFormat added in v0.1.0

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

func (*LoggingFormat) MarshalYAML added in v0.1.0

func (instance *LoggingFormat) MarshalYAML() (interface{}, error)

func (*LoggingFormat) UnmarshalYAML added in v0.1.0

func (instance *LoggingFormat) UnmarshalYAML(unmarshal func(interface{}) error) error

type LoggingLevel

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

func (*LoggingLevel) MarshalYAML

func (instance *LoggingLevel) MarshalYAML() (interface{}, error)

func (*LoggingLevel) UnmarshalYAML

func (instance *LoggingLevel) UnmarshalYAML(unmarshal func(interface{}) error) 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) 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) 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) 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) 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