conf

package
v0.0.0-...-e7f8777 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMapping

func LoadMapping(path string) (map[Country]string, error)

func LoadRegions

func LoadRegions(path string) (map[string]*Region, error)

Types

type Config

type Config struct {
	Listen        string `default:":8100"`
	EtcdEndpoints string
	LogLevel      string `default:"debug"`
}

func Init

func Init(file string) (*Config, error)

func (Config) String

func (c Config) String() string

type Country

type Country string

type IDC

type IDC struct {
	ID     string
	Weight int
}

type Mapping

type Mapping struct {
	Region   string
	Location []string
}

type Region

type Region struct {
	ID    string
	Idcs  []IDC
	Slots []byte
}

type Router

type Router struct {
	Mapping map[Country]string
	Regions map[string]*Region
}

Jump to

Keyboard shortcuts

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