xdsconfig

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIVersion = "1"
	DefaultLogLevel   = "error"
)

Config default values

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AgentUID      string
	Version       string
	APIVersion    string
	VersionGitTag string
	Options       Options
	FileConf      FileConfig
	Log           *logrus.Logger
	LogVerboseOut io.Writer
}

Config parameters (json format) of /config command

func Init

func Init(ctx *cli.Context, log *logrus.Logger) (*Config, error)

Init loads the configuration on start-up

type FileConfig

type FileConfig struct {
	HTTPPort    string          `json:"httpPort"`
	WebAppDir   string          `json:"webAppDir"`
	LogsDir     string          `json:"logsDir"`
	XDSAPIKey   string          `json:"xds-apikey"`
	ServersConf []XDSServerConf `json:"xdsServers"`
	SThgConf    *SyncThingConf  `json:"syncthing"`
}

type Options added in v1.0.0

type Options struct {
	ConfigFile string
	LogLevel   string
	LogFile    string
}

Options set at the command line

type SyncThingConf

type SyncThingConf struct {
	BinDir     string `json:"binDir"`
	Home       string `json:"home"`
	GuiAddress string `json:"gui-address"`
	GuiAPIKey  string `json:"gui-apikey"`
}

type XDSServerConf added in v1.0.0

type XDSServerConf struct {
	URL       string `json:"url"`
	ConnRetry int    `json:"connRetry"`

	// private/not exported fields
	ID            string `json:"-"`
	APIBaseURL    string `json:"-"`
	APIPartialURL string `json:"-"`
}

Jump to

Keyboard shortcuts

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