config

package
v0.0.0-...-df3f4e6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package config provides tools to store and retrieve varda configuration state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAddr

func DefaultAddr() string

func DefaultConfigDir

func DefaultConfigDir() string

Types

type Client

type Client struct {
	User string `json:"user"`
	Pass string `json:"pass"`
	Addr string `json:"addr"`
	TLS  struct {
		Cert string `json:"cert"` // server certificate
	} `json:"tls"`
}

type Config

type Config struct {
	Server Server `json:"server,omitempty"`
	Client Client `json:"client,omitempty"`
}

func Load

func Load() (cfg Config, err error)

func Read

func Read(r io.Reader) (cfg Config, err error)

func ReadFrom

func ReadFrom(fname string) (cfg Config, err error)

type Server

type Server struct {
	Root string `json:"root"`
	Addr string `json:"addr"`
	Pass string `json:"pass"`

	TLS struct {
		Cert string `json:"cert"`
		Priv string `json:"priv"` // server private key
	} `json:"tls"`
}

Jump to

Keyboard shortcuts

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