conf

package
v0.0.0-...-69995ca Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 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"`
	ConsulURL string `default:"localhost:8500"`
	LogLevel  string `default:"INFO"`
}

Config Config

func Init

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

Init InitConfig

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
	Locations []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