xdsconfig

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIVersion    = "1"
	DefaultPort          = "8000"
	DefaultShareDir      = "${HOME}/.xds/server/projects"
	DefaultSTHomeDir     = "${HOME}/.xds/server/syncthing-config"
	DefaultSdkScriptsDir = "${EXEPATH}/sdks"
	DefaultSdkDbUpdate   = "startup"
)

Config default values

View Source
const (
	// GlobalConfigFilename Global config filename
	GlobalConfigFilename = "server-config.json"
	// ServerDataFilename Server data filename
	ServerDataFilename = "server-data.xml"
	// FoldersConfigFilename Folders config filename
	FoldersConfigFilename = "server-config_folders.xml"
	// TargetsConfigFilename Targets config filename
	TargetsConfigFilename = "server-config_targets.xml"
)

Variables

View Source
var ConfigDir = path.Join(".xds", "server")

ConfigDir Directory in user HOME directory where xds config will be saved

Functions

func FoldersConfigFilenameGet

func FoldersConfigFilenameGet() (string, error)

FoldersConfigFilenameGet Return the FoldersConfig filename

func NewBuilderConfig

func NewBuilderConfig(stID string) (xsapiv1.BuilderConfig, error)

NewBuilderConfig creates a new BuilderConfig instance

func ServerDataFilenameGet added in v1.0.0

func ServerDataFilenameGet() (string, error)

ServerDataFilenameGet Return the ServerData filename

func ServerIDGet added in v1.0.0

func ServerIDGet() (string, error)

ServerIDGet Get Server unique ID

func TargetsConfigFilenameGet added in v1.1.0

func TargetsConfigFilenameGet() (string, error)

TargetsConfigFilenameGet Return the TargetsConfig filename

Types

type Config

type Config struct {
	// Public APIConfig fields
	xsapiv1.APIConfig

	// 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"`
	SdkScriptsDir string         `json:"sdkScriptsDir"`
	SdkDbUpdate   string         `json:"sdkDbUpdate"`
	HTTPPort      string         `json:"httpPort"`
	SThgConf      *SyncThingConf `json:"syncthing"`
	LogsDir       string         `json:"logsDir"`
}

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

type Options

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

Options set at the command line

type ServerData added in v1.0.0

type ServerData struct {
	ID string `xml:"id"`
}

ServerData Hold server data saved in ServerData file

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