server

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHeadersMiddleware

func AddHeadersMiddleware(next http.Handler, config *cfg.Config) http.Handler

func NewMux

func NewMux(
	cfg *config.Config,
	options *Options,
	log *log.Logger,
	liveReload bool,
) (*http.ServeMux, error)

Types

type FileWatcher

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

func NewFileWatcher

func NewFileWatcher(log *log.Logger, rootDir string) (*FileWatcher, error)

func (FileWatcher) Add added in v0.2.0

func (i FileWatcher) Add(path string) error

func (FileWatcher) AddRecursive

func (i FileWatcher) AddRecursive(from string) error

func (FileWatcher) Start

func (i FileWatcher) Start(callback func(string))

type HTTPError

type HTTPError struct {
	Error   error
	Message string
	Code    int
}

type LoggingResponseWriter

type LoggingResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewLoggingResponseWriter

func NewLoggingResponseWriter(w http.ResponseWriter) *LoggingResponseWriter

func (*LoggingResponseWriter) Write

func (lrw *LoggingResponseWriter) Write(b []byte) (int, error)

func (*LoggingResponseWriter) WriteHeader

func (lrw *LoggingResponseWriter) WriteHeader(code int)

type Options

type Options struct {
	ReadIndex      *index.ReadIndex
	Store          *storage.Store
	ManpagesURLMap *manpages.URLMap
}

type Server

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

func New

func New(
	conf *config.Config,
	options *Options,
	log *log.Logger,
	liveReload bool,
) (*Server, error)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop() chan struct{}

Jump to

Keyboard shortcuts

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