gateway

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: AGPL-3.0 Imports: 33 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchTLSCertificate

func FetchTLSCertificate(domain string, cacheDir string) (string, string, error)

FetchTLSCertificate will use the ACME protocol and LetsEncrypt to download a certificate to the user's cache dir automatically. This either needs rights to bind :80 (i.e. sudo) or the right capabilities (i.e. sudo setcap CAP_NET_BIND_SERVICE=+ep ~/go/bin/brig)

func UserCacheDir

func UserCacheDir() (string, error)

UserCacheDir is the same as os.UserCacheDir from go1.11, but taken from the standard library. This way it also works for go1.9 and go1.10.

This method should be replaced by os.UserCacheDir by go1.13.

Types

type Gateway

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

Gateway is a small HTTP server that is able to serve files from brig over HTTP. This can be used to share files inside of brig with users that do not use brig.

func NewGateway

func NewGateway(fs *catfs.FS, rapi remotesapi.RemotesAPI, cfg *config.Config, ev *events.Listener, dbPath string) (*Gateway, error)

NewGateway returns a newly built gateway. This function does not yet start a server.

func (*Gateway) Close added in v0.4.0

func (gw *Gateway) Close() error

Close the gateway and clean up all open resouces.

func (*Gateway) Start

func (gw *Gateway) Start()

Start will start the gateway. If the gateway is not enabled in the config, this does nothing. The gateway is started in the background, this method does not block.

func (*Gateway) Stop

func (gw *Gateway) Stop() error

Stop stops the gateway gracefully.

func (*Gateway) UserDatabase added in v0.4.0

func (gw *Gateway) UserDatabase() *db.UserDatabase

UserDatabase returns the user database API.

Directories

Path Synopsis
db
Package remotesapi implements a simple API for accessing all remotes and their online state as well as triggering syncs and diffs.
Package remotesapi implements a simple API for accessing all remotes and their online state as well as triggering syncs and diffs.
Package static contains embedded resources
Package static contains embedded resources
Package templates contains embedded resources
Package templates contains embedded resources

Jump to

Keyboard shortcuts

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