config

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MixedConfig

type MixedConfig struct {
	// Role is an identifier for distinguish the role in spaceship since the server/client are not seperated.
	// supported roles: "server", "client"
	Role `json:"role"`
	// DNS is used for set up the custom dns as an upstream of global resolver.
	*dns.DNS `json:"dns,omitempty"`
	// CAs is used for append the custom CA to the system cert pool.
	CAs []string `json:"cas,omitempty"`
	// LogMode is used for set up specific log mod, defaults to stdout.
	LogMode logger.Mode `json:"log,omitempty"`

	*client.Client
	*server.Server
}

MixedConfig is a server/client mixed config, along with general config.

func NewFromConfigFile

func NewFromConfigFile(path string) (*MixedConfig, error)

NewFromConfigFile loads the config from the file in the specific path.

func NewFromString

func NewFromString(c string) (*MixedConfig, error)

NewFromString loads the config from raw config string in json format (stick to the config structure).

func (*MixedConfig) Apply

func (c *MixedConfig) Apply() error

Apply applies the MixedConfig

type Role

type Role string
const (
	RoleClient Role = "client"
	RoleServer Role = "server"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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