config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2018 License: MIT Imports: 1 Imported by: 12

Documentation

Index

Constants

View Source
const (
	JSONContentType = "application/json"
	HTMLContentType = "text/html"
)

Variables

View Source
var SupportedContentTypes []string = []string{JSONContentType, HTMLContentType}

These are the MIME types that the handlers support.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server    Server
	Logging   Logging
	Metadata  Metadata
	Providers Providers
}
var Configuration Config

func LoadConfigFromFile

func LoadConfigFromFile(tomlFile string) (Config, error)

LoadFromFile read YAML into configuration

type Contact

type Contact struct {
	Name            string `toml:"name"`
	Position        string `toml:"postition"`
	Address         string `toml:"address"`
	City            string `toml:"city"`
	StateOrProvince string `toml:"stateorprovince"`
	PostalCode      string `toml:"postalcode"`
	Country         string `toml:"country"`
	Phone           string `toml:"phone"`
	Fax             string `toml:"fax"`
	Email           string `toml:"email"`
	URL             string `toml:"url"`
	Hours           string `toml:"hours"`
	Instructions    string `toml:"instructions"`
	Role            string `toml:"role"`
}

type Identification

type Identification struct {
	Title             string   `toml:"title"`
	Description       string   `toml:"description"`
	Keywords          []string `toml:"keywords"`
	KeywordsType      string   `toml:"keywords_type"`
	Fees              string   `toml:"fees"`
	AccessConstraints string   `toml:"accessconstraints"`
}

type Logging

type Logging struct {
	Level   string `toml:"level"`
	Logfile string `toml:"logfile"`
}

type Metadata

type Metadata struct {
	Identification  Identification
	ServiceProvider ServiceProvider
	Contact         Contact
}

type Providers

type Providers struct {
	Data string `toml:"data"`
}

type Server

type Server struct {
	BindHost        string `toml:"bind_host"`
	BindPort        int    `toml:"bind_port"`
	URLScheme       string `toml:"url_scheme"`
	URLHostPort     string `toml:"url_hostport"`
	URLBasePath     string `toml:"url_basepath"`
	DefaultMimeType string `toml:"default_mimetype"`
	Encoding        string `toml:"encoding"`
	Language        string `toml:"language"`
	PrettyPrint     bool   `toml:"pretty_print"`
	DefaultLimit    uint   `toml:"paging_limit"`
	MaxLimit        uint   `toml:"paging_maxlimit"`
}

Config provides an object model for configuration.

type ServiceProvider

type ServiceProvider struct {
	Name string `toml:"name"`
	URL  string `toml:"url"`
}

Jump to

Keyboard shortcuts

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