config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prefix     = "pcp"
	ContextKey = "config"
)

Variables

This section is empty.

Functions

func FillContext

func FillContext(c *cli.Context) (*cli.Context, error)

Types

type Config

type Config struct {
	Settings *Settings
}

Config contains general user settings and peer identity information. The configuration is split, so the identity information can easier be saved with more restrict access permissions as it contains the private Key.

func FromContext

func FromContext(ctx context.Context) (*Config, error)

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) Save

func (c *Config) Save() error

Save saves the peer settings and identity information to disk.

type Settings

type Settings struct {
	Path   string `json:"-"`
	Exists bool   `json:"-"`
}

func LoadSettings

func LoadSettings() (*Settings, error)

func (*Settings) Save

func (s *Settings) Save() error

Jump to

Keyboard shortcuts

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