server

package
v0.0.0-...-0db9ae2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 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)

NewServer creates and initializes a new server. Initialization reads the config to set the admin password and backfill books from the csv database if desired.

type Server

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

func (*Server) RunSync

func (s *Server) RunSync() error

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