config

package
v0.0.0-...-c9fa5eb Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config implements functions for saving a struct to a file It then provides functions to later read it such that we can restore the same struct

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// V2 indicates we are version 2
	V2 *v2.V2
	// contains filtered or unexported fields
}

Config represents the config state file

func NewFromDirectory

func NewFromDirectory(dir string) *Config

NewFromDirectory creates a new config struct from a directory It does this by loading the JSON file from disk

func (*Config) Discovery

func (c *Config) Discovery() *discovery.Discovery

Discovery gets the discovery list from the state file

func (*Config) HasSecureInternet

func (c *Config) HasSecureInternet() bool

HasSecureInternet returns whether or not the configuration has a secure internet server

func (*Config) Load

func (c *Config) Load() error

Load loads the state file from disk

func (*Config) Save

func (c *Config) Save() error

Save saves the state file to disk

type Versioned

type Versioned struct {
	// V2 is the version 2 state file
	V2 *v2.V2 `json:"v2,omitempty"`
}

Versioned is the final top-level state file that is written to disk

Directories

Path Synopsis
Package v2 implements version 2 of the state file
Package v2 implements version 2 of the state file

Jump to

Keyboard shortcuts

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