titlehandler

package
v2.5.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(r *mux.Router, baseWebPath string, c *config.Config)

Setup sets up all the routing rules and other configuration

func SortTitles

func SortTitles(list []*Title)

SortTitles does an in-place sort on the given title list, relying solely on the SortName string

Types

type Title

type Title struct {
	*db.Title
	SortName string
}

Title wraps a db.Title for web display

func WrapTitle

func WrapTitle(t *db.Title) *Title

WrapTitle converts a db.Title to a Title, giving it a useful "SortName" based on its name (stripped of common prefixes) and LCCN

func WrapTitles

func WrapTitles(list db.TitleList) []*Title

WrapTitles takes a db.TitleList and wraps each title individually

func (*Title) TitlesDiffer

func (t *Title) TitlesDiffer() bool

TitlesDiffer returns true if the MARC title isn't the same as the name we've given the title. We strip all non-word characters for the comparison.

Jump to

Keyboard shortcuts

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