config

package
v0.0.0-...-550907a Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoralConfig

type CoralConfig struct {
	Common  CoralConfigCommon
	Servers map[string]CoralServer
}

func GetDefaultConfig

func GetDefaultConfig() CoralConfig

func ParseFileConfig

func ParseFileConfig(configFile string) (*CoralConfig, error)

func ParseIniConfig

func ParseIniConfig(str string) (*CoralConfig, error)

func ParseRemoteConfig

func ParseRemoteConfig(url string) (*CoralConfig, error)

type CoralConfigCommon

type CoralConfigCommon struct {
	Host          string          `json:"address"`
	Port          int             `json:"port"`
	DirectTimeout time.Duration   `json:"directTimeout"`
	Whitelist     map[string]bool `json:"whitelist"`
}

func (CoralConfigCommon) Address

func (c CoralConfigCommon) Address() string

type CoralServer

type CoralServer struct {
	Name          string        `json:"name"`
	Type          string        `json:"type"`
	Host          string        `json:"host"`
	Port          string        `json:"port"`
	Method        string        `json:"method"`
	Password      string        `json:"password"`
	Obfs          string        `json:"obfs"`
	ObfsParam     string        `json:"obfsParam"`
	Protocol      string        `json:"protocol"`
	ProtocolParam string        `json:"protocolParam"`
	ReadTimeout   time.Duration `json:"readTimeout"`
}

func UnmarshalServerFormSection

func UnmarshalServerFormSection(name string, section ini.Section) (CoralServer, error)

func (CoralServer) Address

func (c CoralServer) Address() string

Jump to

Keyboard shortcuts

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