settings

package
v0.0.0-...-617b798 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type CaCertConfig

type CaCertConfig struct {
	SerialNumber int64   `json:"serial_number"`
	Subject      Subject `json:"subject"`
	Valid        int     `json:"valid_year"`
	KeyLength    int     `json:"key_length"`
}

type CertJSON

type CertJSON struct {
	CA  CaCertConfig  `json:"ca"`
	Web WebCertConfig `json:"web"`
}

type Service

type Service struct {
	DefaultTLSPort   int      `json:"default_tls_port"`
	SecretTLSPort    int      `json:"secret_tls_port"`
	APIPort          int      `json:"api_port"`
	TrustedLocations []string `json:"trusted_locations"`
}

type Setting

type Setting struct {
	Account        Account  `json:"account"`
	Service        Service  `json:"service"`
	Certificate    CertJSON `json:"certificates"`
	ConfigFile     string   `json:"-"`
	CertificateDir string   `json:"-"`
	DatabasePath   string   `json:"-"`
}
var Settings Setting

Settings stores all values of configuration, make it singleton

func (*Setting) Parse

func (s *Setting) Parse()

type Subject

type Subject struct {
	Organization string `json:"organization"`
	Country      string `json:"country"`
	Province     string `json:"province"`
	Locality     string `json:"locality"`
	Address      string `json:"address"`
	PostalCode   string `json:"postal_code"`
	CommonName   string `json:"common_name"`
}

type WebCertConfig

type WebCertConfig struct {
	SerialNumber int64   `json:"serial_number"`
	Subject      Subject `json:"subject"`
	DNSName      string  `json:"dns_name"`
	Valid        int     `json:"valid_year"`
	KeyLength    int     `json:"key_length"`
}

Jump to

Keyboard shortcuts

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