conffile

package
v1.68.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: BSD-3-Clause Imports: 11 Imported by: 5

Documentation

Overview

Package conffile contains code to load, manipulate, and access config file settings.

Index

Constants

View Source
const VMUserDataPath = "vm:user-data"

VMUserDataPath is a sentinel value for Load to use to get the data from the VM's metadata service's user-data field.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path    string // disk path of HuJSON, or VMUserDataPath
	Raw     []byte // raw bytes from disk, in HuJSON form
	Std     []byte // standardized JSON form
	Version string // "alpha0" for now

	// Parsed is the parsed config, converted from its on-disk version to the
	// latest known format.
	//
	// As of 2023-10-15 there is exactly one format ("alpha0") so this is both
	// the on-disk format and the in-memory upgraded format.
	Parsed ipn.ConfigVAlpha
}

Config describes a config file.

func Load

func Load(path string) (*Config, error)

Load reads and parses the config file at the provided path on disk.

func (*Config) WantRunning

func (c *Config) WantRunning() bool

WantRunning reports whether c is non-nil and it's configured to be running.

Jump to

Keyboard shortcuts

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