settings

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2018 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorListSettings

type ErrorListSettings struct {
	NotFound           *ErrorSettings `yaml:"notFound"`
	ServiceUnavaliable *ErrorSettings `yaml:"serviceUnavaliable"`
}

ErrorListSettings contains the list of avaliable errors from the config

type ErrorSettings

type ErrorSettings struct {
	Status int    `yaml:"status" json:"-"`
	Short  string `yaml:"short" json:"error"`
	Long   string `yaml:"long" json:"message"`
}

ErrorSettings contain information about individual errors

type PluginSettings

type PluginSettings struct {
	Path     string      `yaml:"path"`
	Settings interface{} `yaml:"settings"`
}

PluginSettings contain all settings related to managing plugin modules

type RouteSettings

type RouteSettings struct {
	Path         string `yaml:"path"`
	ServiceName  string `yaml:"service"`
	StripPrefix  string `yaml:"stripPrefix"`
	OptionalAuth bool   `yaml:"optionalAuth"`
}

RouteSettings contain route settings inside of a service

type ServiceSettings

type ServiceSettings struct {
	Name          string `yaml:"name"`
	BaseURLString string `yaml:"url"`

	BaseURL *url.URL
}

ServiceSettings contain all of the rules for services

type Settings

type Settings struct {
	// Non config file values (must be loaded directly)
	ConfigFile string

	Port string `yaml:"port"`

	ErrorListSettings *ErrorListSettings `yaml:"errors"`

	Routes   []*RouteSettings   `yaml:"routes"`
	Services []*ServiceSettings `yaml:"services"`
	Plugins  []*PluginSettings  `yaml:"plugins"`
}

Settings are the root configuration settings for the application

func Load

func Load(configFile string) *Settings

Load will create a settings object and load the config from the settings file

Jump to

Keyboard shortcuts

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