apiserver

package
v0.0.0-...-945c817 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start() error

Types

type Config

type Config struct {
	BindAddr    string
	LogLevel    string
	DatabaseURL string
	SessionKey  string
	TokenSecret string
	ClientUrl   string
}

func NewConfig

func NewConfig() *Config

type Server

type Server struct {
	Mux          *mux.Router
	SessionStore sessions.Store
	Config       *Config
	Logger       *zap.SugaredLogger
	Token        *token.HashToken
	Sanitizer    *bluemonday.Policy
}

func NewServer

func NewServer(config *Config, logger *zap.SugaredLogger) (*Server, error)

func (*Server) ConfigureServer

func (s *Server) ConfigureServer(db *sql.DB)

TODO: separate function

func (*Server) ServeHTTP

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

Jump to

Keyboard shortcuts

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