config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalConfig = ProtoConfig{}

GlobalConfig contains current configurations

Functions

func ReadConfig

func ReadConfig(configFile string)

ReadConfig reads current configurations from configFile

func WriteConfig

func WriteConfig(configFile string, overwrite bool)

WriteConfig write current configurations into configFile

Types

type ProtoConfig

type ProtoConfig struct {
	Listen   string `yaml:"listen"`
	Fallback string `yaml:"fallback"`
	Debug    bool   `yaml:"debug"`
	Timeout  int64  `yaml:"timeout"`

	TLS struct {
		Cert string `yaml:"cert"`
		Key  string `yaml:"key"`
	}

	ProbeConfig struct {
		FakeHost   string   `yaml:"fake_host"`
		AllowHosts []string `yaml:"allow_hosts"`
	}

	Users []ProtoUser `yaml:"users"`
	Rules []ProtoRule `yaml:"rules"`
}

ProtoConfig is Root Configuration Structure

type ProtoRule

type ProtoRule struct {
	Host   string `yaml:"host"`
	Port   int    `yaml:"port"`
	Action string `yaml:"action"`
}

ProtoRule for ACL check

type ProtoUser

type ProtoUser struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

ProtoUser is for users

Jump to

Keyboard shortcuts

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