Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectLegacyINIFormat

func DetectLegacyINIFormat(content []byte) bool

func DetectLegacyINIFormatFromFile

func DetectLegacyINIFormatFromFile(path string) bool

func LoadAdditionalClientConfigs

func LoadAdditionalClientConfigs(paths []string, isLegacyFormat bool, strict bool) ([]v1.ProxyConfigurer, []v1.VisitorConfigurer, error)

func LoadClientConfig

func LoadClientConfig(path string, strict bool) (
	*v1.ClientCommonConfig,
	[]v1.ProxyConfigurer,
	[]v1.VisitorConfigurer,
	bool, error,
)

func LoadClientConfigFromContent

func LoadClientConfigFromContent(content string, strict bool) (
	*v1.ClientCommonConfig,
	[]v1.ProxyConfigurer,
	[]v1.VisitorConfigurer,
	error,
)

func LoadConfigure

func LoadConfigure(b []byte, c any, strict bool) error

LoadConfigure loads configuration from bytes and unmarshal into c. Now it supports json, yaml and toml format.

func LoadConfigureFromContent

func LoadConfigureFromContent(content string, c any, strict bool) error

func LoadConfigureFromFile

func LoadConfigureFromFile(path string, c any, strict bool) error

func LoadFileContentWithTemplate

func LoadFileContentWithTemplate(path string, values *Values) ([]byte, error)

func LoadServerConfig

func LoadServerConfig(path string, strict bool) (*v1.ServerConfig, bool, error)

func NewProxyConfigurerFromMsg

func NewProxyConfigurerFromMsg(m *msg.NewProxy, serverCfg *v1.ServerConfig) (v1.ProxyConfigurer, error)

func RegisterClientCommonConfigFlags

func RegisterClientCommonConfigFlags(cmd *cobra.Command, c *v1.ClientCommonConfig, opts ...RegisterFlagOption)

func RegisterProxyFlags

func RegisterProxyFlags(cmd *cobra.Command, c v1.ProxyConfigurer, opts ...RegisterFlagOption)

func RegisterServerConfigFlags

func RegisterServerConfigFlags(cmd *cobra.Command, c *v1.ServerConfig, opts ...RegisterFlagOption)

func RegisterVisitorFlags

func RegisterVisitorFlags(cmd *cobra.Command, c v1.VisitorConfigurer, opts ...RegisterFlagOption)

func RenderWithTemplate

func RenderWithTemplate(in []byte, values *Values) ([]byte, error)

func WordSepNormalizeFunc

func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WordSepNormalizeFunc changes all flags that contain "_" separators

Types

type BandwidthQuantityFlag

type BandwidthQuantityFlag struct {
	V *types.BandwidthQuantity
}

func (*BandwidthQuantityFlag) Set

func (*BandwidthQuantityFlag) String

func (f *BandwidthQuantityFlag) String() string

func (*BandwidthQuantityFlag) Type

func (f *BandwidthQuantityFlag) Type() string

type BoolFuncFlag

type BoolFuncFlag struct {
	TrueFunc  func()
	FalseFunc func()
	// contains filtered or unexported fields
}

func (*BoolFuncFlag) Set

func (f *BoolFuncFlag) Set(s string) error

func (*BoolFuncFlag) String

func (f *BoolFuncFlag) String() string

func (*BoolFuncFlag) Type

func (f *BoolFuncFlag) Type() string

type NumberPair

type NumberPair struct {
	First  int64
	Second int64
}

type PortsRangeSliceFlag

type PortsRangeSliceFlag struct {
	V *[]types.PortsRange
}

func (*PortsRangeSliceFlag) Set

func (f *PortsRangeSliceFlag) Set(s string) error

func (*PortsRangeSliceFlag) String

func (f *PortsRangeSliceFlag) String() string

func (*PortsRangeSliceFlag) Type

func (f *PortsRangeSliceFlag) Type() string

type RegisterFlagOption

type RegisterFlagOption func(*registerFlagOptions)

func WithSSHMode

func WithSSHMode() RegisterFlagOption

type Values

type Values struct {
	Envs map[string]string // environment vars
}

func GetValues

func GetValues() *Values

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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