Documentation ¶
Index ¶
- func DefaultConfig(path string, myID protocol.DeviceID, evLogger events.Logger, ...) (config.Wrapper, error)
- func LoadConfigAtStartup(path string, cert tls.Certificate, evLogger events.Logger, ...) (config.Wrapper, error)
- func LoadOrGenerateCertificate(certFile, keyFile string) (tls.Certificate, error)
- func OpenDBBackend(path string, tuning config.Tuning) (backend.Backend, error)
- type App
- type ExitStatus
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶ added in v1.2.2
func LoadConfigAtStartup ¶ added in v1.2.2
func LoadConfigAtStartup(path string, cert tls.Certificate, evLogger events.Logger, allowNewerConfig, noDefaultFolder bool) (config.Wrapper, error)
LoadConfigAtStartup loads an existing config. If it doesn't yet exist, it creates a default one, without the default folder if noDefaultFolder is ture. Otherwise it checks the version, and archives and upgrades the config if necessary or returns an error, if the version isn't compatible.
func LoadOrGenerateCertificate ¶ added in v1.2.2
func LoadOrGenerateCertificate(certFile, keyFile string) (tls.Certificate, error)
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) Error ¶
Error returns an error if one occurred while running the app. It does not wait for the app to stop before returning.
func (*App) Start ¶
Start executes the app and returns once all the startup operations are done, e.g. the API is ready for use. Must be called once only.
func (*App) Stop ¶
func (a *App) Stop(stopReason ExitStatus) ExitStatus
Stop stops the app and sets its exit status to given reason, unless the app was already stopped before. In any case it returns the effective exit status.
func (*App) Wait ¶
func (a *App) Wait() ExitStatus
Wait blocks until the app stops running. Also returns if the app hasn't been started yet.
type ExitStatus ¶
type ExitStatus int
const ( ExitSuccess ExitStatus = 0 ExitError ExitStatus = 1 ExitNoUpgradeAvailable ExitStatus = 2 ExitRestart ExitStatus = 3 ExitUpgrade ExitStatus = 4 )
func (ExitStatus) AsInt ¶ added in v1.3.2
func (s ExitStatus) AsInt() int