syncthing

package
v1.2.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MPL-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCertificate

func LoadCertificate(certFile, keyFile string) (tls.Certificate, error)

func LoadConfig

func LoadConfig(path string, cert tls.Certificate) (config.Wrapper, error)

func OpenGoleveldb

func OpenGoleveldb(path string) (*db.Lowlevel, error)

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New(cfg config.Wrapper, ll *db.Lowlevel, cert tls.Certificate, opts Options) *App

func (*App) Error

func (a *App) Error() 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) Run

func (a *App) Run() ExitStatus

Run does the same as start, but then does not return until the app stops. It is equivalent to calling Start and then Wait.

func (*App) Start

func (a *App) Start()

Start executes the app and returns once all the startup operations are done, e.g. the API is ready for use.

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.

type ExitStatus

type ExitStatus int
const (
	ExitSuccess ExitStatus = 0
	ExitError   ExitStatus = 1
	ExitRestart ExitStatus = 3
	ExitUpgrade ExitStatus = 4
)

type Options

type Options struct {
	AssetDir         string
	AuditWriter      io.Writer
	DeadlockTimeoutS int
	NoUpgrade        bool
	ProfilerURL      string
	ResetDeltaIdxs   bool
	Verbose          bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL