Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultConfigPath = filepath.Join(home, ".syftbox", "config.json") DefaultDataDir = filepath.Join(home, "SyftBox") DefaultServerURL = "https://syftbox.net" DefaultClientURL = "http://localhost:7938" DefaultLogFilePath = filepath.Join(home, ".syftbox", "logs", "syftbox.log") DefaultAppsEnabled = true )
View Source
var ( ErrInvalidURL = errors.New("invalid url") ErrInvalidEmail = utils.ErrInvalidEmail )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DataDir string `json:"data_dir" mapstructure:"data_dir"`
Email string `json:"email" mapstructure:"email"`
ServerURL string `json:"server_url" mapstructure:"server_url"`
ClientURL string `json:"client_url,omitempty" mapstructure:"client_url,omitempty"`
ClientToken string `json:"client_token,omitempty" mapstructure:"client_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty" mapstructure:"refresh_token,omitempty"`
// do not persist, keep in memory
AppsEnabled bool `json:"-" mapstructure:"apps_enabled"`
AccessToken string `json:"-" mapstructure:"access_token"`
Path string `json:"-" mapstructure:"config_path"`
}
func LoadFromFile ¶
func LoadFromReader ¶
func LoadFromReader(path string, reader io.ReadCloser) (*Config, error)
Click to show internal directories.
Click to hide internal directories.