library

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package library is the books the shelf and the book pages show.

Index

Constants

View Source
const PerPage = 5

Variables

View Source
var Books = []Book{
	{1, "Things Fall Apart", "Chinua Achebe"}, {2, "Petals of Blood", "Ngũgĩ wa Thiong'o"},
	{3, "Half of a Yellow Sun", "Chimamanda Ngozi Adichie"}, {4, "Season of Migration to the North", "Tayeb Salih"},
	{5, "The Famished Road", "Ben Okri"}, {6, "Paradise", "Abdulrazak Gurnah"},
	{7, "Nervous Conditions", "Tsitsi Dangarembga"}, {8, "So Long a Letter", "Mariama Bâ"},
	{9, "Weep Not, Child", "Ngũgĩ wa Thiong'o"}, {10, "The Beautyful Ones Are Not Yet Born", "Ayi Kwei Armah"},
	{11, "Americanah", "Chimamanda Ngozi Adichie"}, {12, "By the Sea", "Abdulrazak Gurnah"},
	{13, "Disgrace", "J. M. Coetzee"}, {14, "The Joys of Motherhood", "Buchi Emecheta"},
	{15, "Arrow of God", "Chinua Achebe"}, {16, "Kintu", "Jennifer Nansubuga Makumbi"},
	{17, "Afterlives", "Abdulrazak Gurnah"}, {18, "The Promise", "Damon Galgut"},
}

Functions

func BookURL

func BookURL(id int) string

func Pages

func Pages() int

Pages is the number of the shelf's pages.

func ShelfURL

func ShelfURL(page int) string

Types

type Book

type Book struct {
	ID     int    `json:"id"`
	Title  string `json:"title"`
	Author string `json:"author"`
}

Book is a book of the shelf.

func Get

func Get(id int) Book

Get is the book id, the nearest one for an id out of range.

Jump to

Keyboard shortcuts

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