bibliotheca

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 9 Imported by: 0

README

bibliotheca 📚

Go library for Bibliotheca cloudLibrary

WARNING: This library makes unsafe type assertions, and may panic. Additionally, it may panic for other reasons. Please don't trust it.

See the test (singular 😅) for some example usage!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.1.0

type Action string // an action that can be preformed
const (
	Return Action = "Return"
	Borrow Action = "Borrow"
)

type Book added in v0.1.0

type Book struct {
	Id     string
	Title  string
	Author string
	ISBN   string
}

func NewBook added in v0.1.0

func NewBook(id string, library *url.URL) (*Book, error)

type Patron added in v0.1.0

type Patron struct {
	Id      string
	Library *url.URL
	Client  http.Client
}

Patron is a representation of a patron's session with a library

func NewPatron added in v0.1.0

func NewPatron(id string, library *url.URL) (*Patron, error)

NewPatron authenticates as the specified patron with the specified library

func (*Patron) AllowedAction added in v0.1.0

func (p *Patron) AllowedAction(book *Book) (Action, error)

AllowedAction returns the action(s) a patron can preform on a book.

func (*Patron) Borrow added in v0.1.0

func (p *Patron) Borrow(book *Book) error

Borrow borrows the specified book as the patron

func (*Patron) Borrowed added in v0.1.0

func (p *Patron) Borrowed() ([]*Book, error)

Borrowed returns an array of the books currently borrowed by a patron.

func (*Patron) Download added in v0.1.0

func (p *Patron) Download(book *Book) (string, error)

Download an ASCM file for the specified book.

func (*Patron) Return added in v0.1.0

func (p *Patron) Return(book *Book) error

Return the specified book as the patron.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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