config

package
v0.2.0-beta-2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort            = uint16(8080)
	DefaultResponseTimeout = time.Second
	DefaultLogLevel        = logrus.InfoLevel
	DefaultNullProbability = 0.5
	DefaultMaxInt          = int64(math.MaxInt32)
	DefaultMinFloat        = -float64(math.MaxInt32 / 2)
	DefaultMaxFloat        = float64(math.MaxInt32 / 2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// OpenAPI options
	SpecificationURL string

	// HTTP server options
	CORSEnabled     bool
	Port            uint16
	ResponseTimeout time.Duration

	// Application options
	Debug     bool
	LogFormat string
	LogLevel  logrus.Level

	// Generation options
	UseExamples     data.UseExamplesEnum
	NullProbability float64
	DefaultMinInt   int64
	DefaultMaxInt   int64
	DefaultMinFloat float64
	DefaultMaxFloat float64
	SuppressErrors  bool
}

func Load

func Load(filename string) (*Configuration, error)

func (*Configuration) Dump

func (config *Configuration) Dump() map[string]interface{}

type ErrInvalidConfiguration

type ErrInvalidConfiguration struct {
	ValidationError error
}

func (*ErrInvalidConfiguration) Error

func (err *ErrInvalidConfiguration) Error() string

type ErrLoadFailed

type ErrLoadFailed struct {
	Previous error
}

func (*ErrLoadFailed) Error

func (err *ErrLoadFailed) Error() string

func (*ErrLoadFailed) Unwrap

func (err *ErrLoadFailed) Unwrap() error

Jump to

Keyboard shortcuts

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