server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalConfig = &Config{
		Addr:    "127.0.0.1:4880",
		SslAddr: "127.0.0.1:4843",
	}
	Passwords = make(map[string]*Password)
)

config var

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr      string `yaml:"addr"`
	SslAddr   string `yaml:"sslAddr"`
	Cert      string
	Key       string
	Passwords []string
	Routes    []Route
	Instances []Instance
}

func GetConfig

func GetConfig() *Config

func Load

func Load(path string) (config *Config, err error)

type Filter

type Filter struct {
	Name     string
	Params   interface{}
	Open     bool
	Loggable bool
}

type Instance

type Instance struct {
	Group        string
	URL          string `yaml:"url"`
	Weight       int
	RegisterTime int64
	Tags         []string
}

type Password

type Password struct {
	Raw  string
	Hash string
}

type Route

type Route struct {
	ID       string `yaml:"id"`
	Order    int
	Host     string
	Path     string
	Filters  []Filter
	Loggable bool
}

func (Route) GetFilter

func (r Route) GetFilter(name string) Filter

Jump to

Keyboard shortcuts

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