config

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 14 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
	DryRun    bool
	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 InvalidConfigurationError added in v0.3.0

type InvalidConfigurationError struct {
	ValidationError error
}

func (*InvalidConfigurationError) Error added in v0.3.0

func (err *InvalidConfigurationError) Error() string

type LoadingFailedError added in v0.3.0

type LoadingFailedError struct {
	Previous error
}

func (*LoadingFailedError) Error added in v0.3.0

func (err *LoadingFailedError) Error() string

func (*LoadingFailedError) Unwrap added in v0.3.0

func (err *LoadingFailedError) Unwrap() error

Jump to

Keyboard shortcuts

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