server

package
v0.0.0-...-d262b53 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr string `default:":8080" help:"port to listen on"`
}

Config defines the configuration for the longform server.

type Server

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

Server defines the necessary components to host the longform server.

func New

func New(log *zap.Logger, cfg Config, staticFS embed.FS) (s *Server, err error)

New creates a new longform server based on the provided config and static directory.

func (*Server) Close

func (server *Server) Close() error

Close closes the server.

func (*Server) Serve

func (server *Server) Serve() error

Serve starts the longform server.

func (*Server) ServeStatic

func (server *Server) ServeStatic(w http.ResponseWriter, r *http.Request) bool

ServeStatic will serve the requested static asset if possible. If served, will return true.

Jump to

Keyboard shortcuts

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