server

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2017 License: BSD-3-Clause Imports: 58 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure added in v0.5.1

func Configure(o Options) (err error)

Configure initializes http server with provided options.

func Serve added in v0.5.1

func Serve() error

Serve starts HTTP servers.

func Shutdown added in v0.5.1

func Shutdown(ctx context.Context)

Shutdown gracefully terminates HTTP servers.

Types

type EmailService added in v0.5.1

type EmailService interface {
	Notify(title, body string) error
	SendEmail(from string, to []string, subject string, body string) error
}

EmailService defines interface for sending email messages.

type Options

type Options struct {
	Name                    string
	Version                 string
	BuildInfo               string
	Brand                   string
	Listen                  string
	ListenTLS               string
	ListenInternal          string
	ListenInternalTLS       string
	TLSKey                  string
	TLSCert                 string
	Domain                  string
	Headers                 map[string]string
	XSRFCookieName          string
	SessionCookieName       string
	AssetsDir               string
	StaticDir               string
	TemplatesDir            string
	StorageDir              string
	MaintenanceFilename     string
	GoogleAnalyticsID       string
	RememberMeDays          int
	DefaultFrom             string
	ContactRecipientEmail   string
	ACMEDirectoryURL        string
	ACMEDirectoryURLStaging string
	SkipDomainVerification  bool
	VerificationSubdomain   string
	TrustedDomains          []string
	ForbiddenDomains        []string
	APITrustedProxyCIDRs    []string
	APIProxyRealIPHeader    string
	APIHourlyRateLimit      int
	APIEnabled              bool

	Logger              *logging.Logger
	AccessLogger        *logging.Logger
	AuditLogger         *logging.Logger
	PackageAccessLogger *logging.Logger

	EmailService    EmailService
	RecoveryService recovery.Service

	SessionService      session.Service
	UserService         user.Service
	NotificationService notification.Service
	CertificateService  certificate.Service
	PackagesService     packages.Service
	KeyService          key.Service
	GCRAStoreService    gcrastore.Service
}

Options structure contains server's configurable properties.

Directories

Path Synopsis
Package config holds project and service related data and structures that define optional parameters for different parts of the service.
Package config holds project and service related data and structures that define optional parameters for different parts of the service.

Jump to

Keyboard shortcuts

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