server

package
v0.0.0-...-500edce Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedirectServer

func NewRedirectServer(rootURL string) *http.Server

NewRedirectServer creates a new http.Server that redirects all requests to the respective https equivalent.

Types

type ServerConfig

type ServerConfig struct {
	Addr                     string
	IndexFileName            string
	AssetsFolder             string
	AvatarFolder             string
	MediaFolder              string
	RootURL                  string
	AllowedRequestsPerMinute int
	Webpages                 []string
}

type Webserver

type Webserver struct {
	Server *http.Server
	// contains filtered or unexported fields
}

func New

func New(
	cfg ServerConfig,
	userService user.Service,
	cService conversations.Service,
	mService messaging.Service,
	socket *websocket.Server,
	session *session.Manager,
	limiterStore throttled.GCRAStore,
	logger log.Logger) *Webserver

New creates a new instance of type Webserver

func (*Webserver) ServeHTTP

func (s *Webserver) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Webserver) SetupFileServer

func (s *Webserver) SetupFileServer()

SetupFileServer sets up file server handlers for all webpages and its subpages.

func (*Webserver) SetupRestHandlers

func (s *Webserver) SetupRestHandlers()

SetupRestHandlers registers all the REST routes

Jump to

Keyboard shortcuts

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