nlb

package
v0.0.0-...-12a24be Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: EUPL-1.2 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailability

func GetAvailability(isbn string)

GetAvailability fetches availability of a given book

func GetBookURLByTitle

func GetBookURLByTitle(title string, isExact bool) (string, error)

GetBookURLByTitle searches NLB's catalogue by title and returns the URL of the book ENTRY_NAME=BS is basic search, ENTRY_NAME=TI is title search ENTRY_TYPE=K is keyword, ENTRY_TYPE=E is exact search QRYTEXT specifies category of items

func Setup

func Setup(apiKey string)

Setup initialises the NLB WDSL client

Types

type AvailabilityInfo

type AvailabilityInfo struct {
	BranchCode string
	BranchName string
	Status     string
}

AvailabilityInfo models the information about the status of the item at each branch

type Book

type Book struct {
	Title        string
	CallNumber   string
	Availability []AvailabilityInfo
}

Book models the info returned from the NLB API

func GetAvailabilityByTitle

func GetAvailabilityByTitle(title string, isExact bool) (Book, error)

GetAvailabilityByTitle takes a book title and returns the availability info

func GetAvailabilityByURL

func GetAvailabilityByURL(url string) (Book, error)

GetAvailabilityByURL takes a book URL and returns availability info

Jump to

Keyboard shortcuts

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