config

package
v0.0.0-...-b9f95b1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 6 Imported by: 4

Documentation

Overview

Package config config opts and config file

Index

Constants

This section is empty.

Variables

View Source
var Opts struct {
	Conf     string `long:"conf" default:"config.yml" description:"stuns config file"`
	LogLevel string `long:"log_level" default:"info" description:"log level"`
	LogFile  string `long:"log_file" default:"stdout" description:"log file"`
}

Functions

This section is empty.

Types

type Server

type Server struct {
	Port     int    `yaml:"port"`
	Address  string `yaml:"bind"`
	Protocol string `yaml:"proto"`
	Pass     string `yaml:"pass"`
}

type Settings

type Settings struct {
	Upstreams []Upstream `yaml:"upstreams"`
	Servers   []Server   `yaml:"servers"`
}

func Load

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

type Upstream

type Upstream struct {
	Name    string   `yaml:"name"`
	Type    string   `yaml:"type,omitempty"`
	Targets []string `yaml:"targets"`
	Hash    string   `yaml:"hash"`
}

func (*Upstream) UnmarshalYAML

func (m *Upstream) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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