server

package
v0.0.0-...-ace544b Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package server runs a web server to display and manage the library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllBooksDatabase

type AllBooksDatabase interface {
	AllBooks() ([]book.Book, error)
}

type Config

type Config struct {
	Port          string
	DatabaseURL   string
	BackfillCSV   bool
	UpdateImages  bool
	DumpCSV       bool
	AdminPassword string
	MaxRows       int
	DBTimeoutSec  int
	PostLimitSec  int
	PostMaxBurst  int
}

func (Config) NewServer

func (cfg Config) NewServer(ctx context.Context, out io.Writer) (*Server, error)

type Server

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

func (*Server) RunSync

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

RunSync initializes the server and then serves it. Initialization reads the config to set the admin password and backfill books from the csv database if desired.

Directories

Path Synopsis
Package bcrypt can be used to hash data
Package bcrypt can be used to hash data

Jump to

Keyboard shortcuts

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