config

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Host  string `json:"host,omitempty" envconfig:"HOST"`
	Port  int    `json:"port,omitempty" envconfig:"PORT"`
	Token string `json:"token,omitempty" envconfig:"TOKEN"`
}

type Config

type Config struct {
	Path string     `json:"-"`
	API  APIConfig  `json:"api"`
	Peer PeerConfig `json:"peer"`
}

func New

func New() *Config

func (*Config) Load

func (c *Config) Load() error

func (*Config) Update

func (c *Config) Update() error

type PeerConfig

type PeerConfig struct {
	AnnounceHostname   string             `json:"hostname,omitempty" envconfig:"HOSTNAME"`
	BootstrapKeys      []string           `json:"bootstrapKeys,omitempty" envconfig:"BOOTSTRAP_KEYS"`
	BootstrapAddresses []string           `json:"bootstrapAddresses,omitempty" envconfig:"BOOTSTRAP_ADDRESSES"`
	EnableMetrics      bool               `json:"metrics,omitempty" envconfig:"METRICS"`
	IdentityKey        crypto.PrivateKey  `json:"identityKey,omitempty" envconfig:"IDENTITY_KEY"`
	PeerKey            crypto.PrivateKey  `json:"peerKey,omitempty" envconfig:"KEY"`
	TCPPort            int                `json:"tcpPort,omitempty" envconfig:"TCP_PORT"`
	RelayAddresses     []crypto.PublicKey `json:"relayAddresses,omitempty" envconfig:"RELAY_ADDRESSES"`
	ContentTypes       []string           `json:"contentTypes,omitempty" envconfig:"CONTENT_TYPES"`
}

nolint: lll

Jump to

Keyboard shortcuts

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