xdsconfig

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIVersion = "1"
	DefaultPort       = "8000"
	DefaultShareDir   = "/mnt/share"
	DefaultSdkRootDir = "/xdt/sdk"
)

Config default values

View Source
const (
	// ConfigDir Directory in user HOME directory where xds config will be saved
	ConfigDir = ".xds"
	// GlobalConfigFilename Global config filename
	GlobalConfigFilename = "config.json"
	// FoldersConfigFilename Folders config filename
	FoldersConfigFilename = "server-config_folders.xml"
)

Variables

This section is empty.

Functions

func FoldersConfigFilenameGet

func FoldersConfigFilenameGet() (string, error)

FoldersConfigFilenameGet

Types

type BuilderConfig

type BuilderConfig struct {
	IP          string `json:"ip"`
	Port        string `json:"port"`
	SyncThingID string `json:"syncThingID"`
}

BuilderConfig represents the builder container configuration

func NewBuilderConfig

func NewBuilderConfig(stID string) (BuilderConfig, error)

NewBuilderConfig creates a new BuilderConfig instance

func (*BuilderConfig) Copy

func (c *BuilderConfig) Copy(n BuilderConfig)

Copy makes a real copy of BuilderConfig

type Config

type Config struct {
	Version       string        `json:"version"`
	APIVersion    string        `json:"apiVersion"`
	VersionGitTag string        `json:"gitTag"`
	Builder       BuilderConfig `json:"builder"`

	// Private (un-exported fields in REST GET /config route)
	Options       Options        `json:"-"`
	FileConf      FileConfig     `json:"-"`
	Log           *logrus.Logger `json:"-"`
	LogVerboseOut io.Writer      `json:"-"`
}

Config parameters (json format) of /config command

func Init

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

Init loads the configuration on start-up

type FileConfig

type FileConfig struct {
	WebAppDir    string         `json:"webAppDir"`
	ShareRootDir string         `json:"shareRootDir"`
	SdkRootDir   string         `json:"sdkRootDir"`
	HTTPPort     string         `json:"httpPort"`
	SThgConf     *SyncThingConf `json:"syncthing"`
	LogsDir      string         `json:"logsDir"`
}

FileConfig is the JSON structure of xds-server config file (config.json)

type Options

type Options struct {
	ConfigFile     string
	LogLevel       string
	LogFile        string
	NoFolderConfig bool
}

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"`
	RescanIntervalS int    `json:"rescanIntervalS"`
}

SyncThingConf definition

Jump to

Keyboard shortcuts

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