server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2017 License: BSD-3-Clause Imports: 52 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Name                    string
	Version                 string
	BuildInfo               string
	Brand                   string
	Domain                  string
	RedirectToHTTPS         bool
	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
	ForbiddenDomains        []string
	TLSEnabled              bool

	EmailService    email.Service
	RecoveryService recovery.Service

	SessionService      session.Service
	UserService         user.Service
	NotificationService notification.Service
	CertificateService  certificate.Service
	PackagesService     packages.Service
}

Options structure contains optional properties for the Server.

type ServeOptions

type ServeOptions struct {
	Listen            string
	ListenTLS         string
	ListenInternal    string
	ListenInternalTLS string
	TLSKey            string
	TLSCert           string
}

ServeOptions structure contains options for HTTP servers when invoking Server.Serve.

type Server

type Server struct {
	Options
	// contains filtered or unexported fields
}

Server contains all required properties, services and functions to provide core functionality.

func NewServer

func NewServer(o Options) (s *Server, err error)

NewServer creates a new instance of Server with HTTP handlers.

func (*Server) Serve

func (s *Server) Serve(o ServeOptions) error

Serve starts HTTP servers based on provided ServeOptions properties.

func (*Server) Shutdown added in v0.4.1

func (s *Server) Shutdown(ctx context.Context)

Shutdown gracefully terminates HTTP servers.

func (Server) Version

func (s Server) Version() string

Version returns service version based on values from version and build information.

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