xdsconfig

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 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"
)

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"
)

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

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

func ServerIDGet added in v1.0.0

func ServerIDGet() (string, error)

ServerIDGet

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"`
	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"`
}

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