opac

package
v0.0.0-...-8234efa Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Title       string    `json:"title"`
	DateDue     time.Time `json:"date_due"`
	LibraryName string    `json:"library_name"`
	Renewable   bool      `json:"renewable"`
}

Book yada

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client holds a connection to opac

func NewClient

func NewClient(user string, password string) (*Client, error)

New creates a new Client

func (*Client) Fee

func (s *Client) Fee() (*http.Response, error)

Fee returns fees

func (*Client) Loans

func (s *Client) Loans() (*http.Response, error)

Loans returns all loans

func (*Client) Login

func (s *Client) Login() error

Login performs a login

func (*Client) Reservations

func (s *Client) Reservations() (*http.Response, error)

Reservations returns tada

type Opac

type Opac struct {
	Name         string        `json:"name"`
	Fee          float64       `json:"fee"`
	Updated      time.Time     `json:"updated"`
	Books        []Book        `json:"books"`
	Reservations []Reservation `json:"reservations"`
}

Opac holds library loans

func New

func New(name string) *Opac

New returns a new Opac

func Parse

func Parse(client *Client, opac *Opac) (*Opac, error)

Parse parses opac loan data

func (*Opac) FirstDue

func (o *Opac) FirstDue() (book Book)

FirstDue returns the first book due for return

func (*Opac) ReservationPickup

func (o *Opac) ReservationPickup() bool

ReservationPickup returns true if any book reserved is due for pickup

type Reservation

type Reservation struct {
	Title        string    `json:"title"`
	QuePosition  int       `json:"que_position"`
	BooksTotal   int       `json:"books_total"`
	PickupDue    time.Time `json:"pickup_due"`
	PickupNumber int       `json:"pickup_number"`
}

Reservation yada

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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