config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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,
)

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

func LoadConfigure

func LoadConfigure(b []byte, 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 ParseFRPCConfigToSSHCmd

func ParseFRPCConfigToSSHCmd(
	cfg *v1.ClientCommonConfig,
	proxyCfgs []v1.ProxyConfigurer,
	visitorCfgs []v1.VisitorConfigurer,
) []string

ParseFRPCConfigToSSHCmd parse standard frpc config to standard ssh commands

func RenderWithTemplate

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

Types

type GoSSHParam

type GoSSHParam struct {
	LocalAddr   string
	ServerAddr  string
	SSHExtraCmd string
}

func ParseFRPCConfigToGoSSHParam

func ParseFRPCConfigToGoSSHParam(
	cfg *v1.ClientCommonConfig,
	proxyCfgs []v1.ProxyConfigurer,
	visitorCfgs []v1.VisitorConfigurer,
) (res []GoSSHParam)

type Values

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

func GetValues

func GetValues() *Values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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