redirect

package
v0.0.0-...-4afba3a Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Entries  map[string][]IndexEntry
	Suites   map[string]string
	Langs    map[string]bool
	Sections map[string]bool
}

func IndexFromProto

func IndexFromProto(path string) (Index, error)

func (Index) Narrow

func (i Index) Narrow(acceptLang string, template, ref IndexEntry, entries []IndexEntry) []IndexEntry

func (Index) Redirect

func (i Index) Redirect(r *http.Request) (string, error)

type IndexEntry

type IndexEntry struct {
	Name      string // TODO: string pool
	Suite     string // TODO: enum to save space
	Binarypkg string // TODO: sort by popcon, TODO: use a string pool
	Section   string // TODO: use a string pool
	Language  string // TODO: type: would it make sense to use language.Tag?
}

func (IndexEntry) ServingPath

func (e IndexEntry) ServingPath(suffix string) string

type NotFoundError

type NotFoundError struct {
	Manpage    string
	BestChoice IndexEntry
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Jump to

Keyboard shortcuts

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