frontend

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// URL is where the CLI makes http requests to
	URL = "http://localhost:7274"
)

Variables

View Source
var ErrInvalidInput = errors.New("cli: invalid input")

ErrInvalidInput occurs when the user's input is invalid

View Source
var ErrInvalidResponse = errors.New("cli: failed to parse the http response")

ErrInvalidResponse occurs when the http response is invalid

View Source
var ErrReadResponseFailed = errors.New("cli: failed to read the http response")

ErrReadResponseFailed occurs when failed to read the http response

View Source
var ErrRequestFailed = errors.New("cli: failed to make an http request, did you start realmsd?")

ErrRequestFailed occurs when failed to make an http request

Functions

func AddBook

func AddBook(jar *cookiejar.Jar) error

AddBook adds a new book to the library

func AddUser

func AddUser(jar *cookiejar.Jar) error

AddUser adds a new user to the database

func BorrowBook

func BorrowBook(jar *cookiejar.Jar) error

BorrowBook borrows a book from the library

func ExtendDeadline

func ExtendDeadline(jar *cookiejar.Jar) error

ExtendDeadline extends the deadline to return a book

func FindBooks

func FindBooks(jar *cookiejar.Jar) error

FindBooks finds books by title / author / ISBN

func Login

func Login(jar *cookiejar.Jar) error

Login helps the user log in to his/her library account

func Logout

func Logout(jar *cookiejar.Jar) error

Logout helps the user log out of his/her library account

func Me

func Me(jar *cookiejar.Jar) error

Me shows the currently logged-in user

func RemoveBook

func RemoveBook(jar *cookiejar.Jar) error

RemoveBook removes a book from the library

func RemoveUser

func RemoveUser(jar *cookiejar.Jar) error

RemoveUser removes a user from the database

func ReturnBook

func ReturnBook(jar *cookiejar.Jar) error

ReturnBook returns a book to the library

func ShowBook

func ShowBook() error

ShowBook shows the book of given ID

func ShowBookList

func ShowBookList(jar *cookiejar.Jar) error

ShowBookList shows all books that the user has borrowed

func ShowBooks

func ShowBooks() error

ShowBooks shows all books in the library

func ShowBorrowed

func ShowBorrowed(jar *cookiejar.Jar) error

ShowBorrowed shows a book that the user has borrowed

func ShowHelp

func ShowHelp() error

ShowHelp shows a list of commands

func ShowHistory

func ShowHistory(jar *cookiejar.Jar) error

ShowHistory shows all records of the user

func ShowOverdueList

func ShowOverdueList(jar *cookiejar.Jar) error

ShowOverdueList shows all overdue books that the user has borrowed

func ShowUser

func ShowUser(jar *cookiejar.Jar) error

ShowUser shows the user of given ID

func ShowUsers

func ShowUsers(jar *cookiejar.Jar) error

ShowUsers shows all users in the library

func Status

func Status(jar *cookiejar.Jar) error

Status shows current login status

func UpdateBook

func UpdateBook(jar *cookiejar.Jar) error

UpdateBook updates data of a book

func UpdateUser

func UpdateUser(jar *cookiejar.Jar) error

UpdateUser updates data of a user

Types

This section is empty.

Jump to

Keyboard shortcuts

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