Documentation
¶
Overview ¶
Package configs provides tools for managing configurations
Index ¶
- Variables
- func ApplicationDataDir() string
- func ConfigureCaddyfile(t string, v interface{}) error
- func Del(path ...string)
- func FrontClearCache(rootFolder string)
- func FrontTouchAdditionalFiles(rootFolder string)
- func FrontWriteBootstrap(rootFolder string, conf *FrontBootstrapConf) error
- func Get(path ...string) reader.Value
- func GetDatabase(name string) (string, string)
- func GetDefaultDatabase() (string, string)
- func GetFile() string
- func InitCaddyFile(tpl string, tplData interface{}) error
- func ServiceDataDir(serviceName string) (string, error)
- func Set(val interface{}, path ...string)
- type CaddyTemplateConf
- type Config
- type FrontBootstrapConf
- type Map
- func (c Map) Bool(key string, def ...bool) bool
- func (c Map) Database(k string) (string, string)
- func (c Map) Del(key string) error
- func (c Map) Get(key string) interface{}
- func (c Map) Int(key string, def ...int) int
- func (c Map) Int64(key string, defaultValue ...int64) int64
- func (c Map) Map(key string) map[string]interface{}
- func (c Map) Set(key string, value interface{}) error
- func (c Map) String(key string) string
- func (c Map) StringArray(key string) []string
- func (c Map) StringMap(key string) map[string]string
- type Value
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var ( CaddyTemplate = `` /* 748-byte string literal not displayed */ DefaultCaddyfile = filepath.Join(ApplicationDataDir(), "Caddyfile") )
var ( PydioConfigDir = ApplicationDataDir() PydioConfigFile = "pydio.json" )
var SampleConfig = `` /* 3426-byte string literal not displayed */
Functions ¶
func ApplicationDataDir ¶
func ApplicationDataDir() string
ApplicationDataDir creates a local file to store pydio system data
func FrontClearCache ¶
func FrontClearCache(rootFolder string)
FrontWriteBootstrap clears the frontend caches
func FrontTouchAdditionalFiles ¶
func FrontTouchAdditionalFiles(rootFolder string)
FrontWriteBootstrap touches additional files in frontend boot.conf folder to avoid triggering an install process in the frontend
func FrontWriteBootstrap ¶
func FrontWriteBootstrap(rootFolder string, conf *FrontBootstrapConf) error
FrontWriteBootstrap takes a config, executes the template and save to the front
func GetDatabase ¶
GetDatabase retrieves the database data from the config
func GetDefaultDatabase ¶
GetDefaultDatabase returns the information for the default database
func InitCaddyFile ¶
InitCaddyFile creates a caddy LoaderFunc with the correct contents
func ServiceDataDir ¶
ServiceDataDir returns the applicationdir/services/serviceName and creates it if it does not exists
Types ¶
type CaddyTemplateConf ¶
type CaddyTemplateConf struct {
// Main site URL
Bind *url.URL
// Micro REST API dispatcher
Micro *url.URL
// Open ID Connect Service
Dex *url.URL
// S3 Gateway
Gateway *url.URL
// WebSocket server
WebSocket *url.URL
// Plugins loader for frontend
FrontPlugins *url.URL
// FPM connection, either an URL or a socket file path
Fpm string
// Root of the PHP Frontend
Root string
// Dedicated log file for caddy errors to ease debugging
Logs string
// Caddy compliant TLS string, either "self_signed" or paths to "cert key"
TLS string
}
CaddyTemplateConf feeds Caddy template file with data
func LoadCaddyConf ¶
func LoadCaddyConf() (*CaddyTemplateConf, error)
LoadCaddyConf reads the pydio config and fill a CaddyTemplateConf object ready to be executed by template
type Config ¶
Config wrapper around micro Config
type FrontBootstrapConf ¶
type FrontBootstrapConf struct {
ProxyUrl *url.URL
WebSocketUrl *url.URL
DexID string
DexSecret string
DisableSslVerify string
}
Data passed to the bootstrapConf template
func FrontBootstrapFromConfig ¶
func FrontBootstrapFromConfig(proxyUrl string) (*FrontBootstrapConf, error)
FrontBootstrapFromConfig reads pydio config to generate the associated bootstrap.conf for frontend.
type Map ¶
type Map map[string]interface{}
Map structure to store configuration
func (Map) Database ¶
Database returns the driver and dsn in that order for the given key
func (Map) Get ¶
Get retrieves the first value associated with the given key. If there are no values associated with the key, Get returns the empty string. To access multiple values, use the map directly.
func (Map) Int ¶
Int retrieves the value at the given key if it exists and performs best effort to cast it as an int. If no such key exists or if it cannot be cast as an int, it returns the default value if defined and 0 otherwise.
func (Map) Int64 ¶
Int64 retrieves the value at the given key if it exists and performs best effort to cast it as an int64. If no such key exists or if it cannot be cast as an int64, it returns the default value if defined and 0 otherwise.
func (Map) Set ¶
Set sets the key to value. It replaces any existing values.
type Value ¶
type Value interface {
Bool(def bool) bool
Int(def int) int
Int64(def int64) int64
String(def string) string
Float64(def float64) float64
Duration(def time.Duration) time.Duration
StringSlice(def []string) []string
StringMap(def map[string]string) map[string]string
Scan(val interface{}) error
Bytes() []byte
}
Value Represent a value retrieved from the values loaded
Source Files
¶
- caddy.go
- config.go
- databases.go
- dirs.go
- frontend.go
- sample.go
- values.go
- vars.go
- watcher.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package envvar implements Pydio specific interface for dynamic configurations that are backed by OS environment variables.
|
Package envvar implements Pydio specific interface for dynamic configurations that are backed by OS environment variables. |
|
Package source implements a configuration client backed by a config server
|
Package source implements a configuration client backed by a config server |