config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PATH string

	WebPort        int    `json:"web_port,omitempty"`
	WebToken       string `json:"web_token,omitempty"`
	EnablePing     bool   `json:"enable_ping,omitempty"`
	LogLeveL       string `json:"log_level,omitempty"`
	ReloadInterval int    `json:"reload_interval,omitempty"`

	RelayConfigs []*RelayConfig `json:"relay_configs"`

	XRayConfig          *xrayCfg.Config `json:"xray_config,omitempty"`
	SyncTrafficEndPoint string          `json:"sync_traffic_endpoint"`

	L *zap.SugaredLogger
}

func NewConfig added in v1.1.3

func NewConfig(path string) *Config

func (*Config) GetMetricURL added in v1.1.3

func (c *Config) GetMetricURL() string

func (*Config) LoadConfig

func (c *Config) LoadConfig() error

func (*Config) NeedStartWebServer added in v1.1.3

func (c *Config) NeedStartWebServer() bool

func (*Config) NeedSyncUserFromServer added in v1.1.2

func (c *Config) NeedSyncUserFromServer() bool

func (*Config) Validate added in v1.1.2

func (c *Config) Validate() error

type RelayConfig

type RelayConfig struct {
	Listen        string   `json:"listen"`
	ListenType    string   `json:"listen_type"`
	TransportType string   `json:"transport_type"`
	TCPRemotes    []string `json:"tcp_remotes"`
	UDPRemotes    []string `json:"udp_remotes"`
	Label         string   `json:"label"`
}

func (*RelayConfig) Validate added in v1.1.2

func (r *RelayConfig) Validate() error

Jump to

Keyboard shortcuts

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