Documentation ¶
Overview ¶
Pacchetto per interfacciarsi con il database SQL
Index ¶
- func AddAutore(nome, cognome string) (uint32, error)
- func AddGenere(nome string) (uint32, error)
- func AddLibro(titolo string, autore, genere uint32) (uint32, error)
- func AddPrestito(libro uint32, utente string, durata uint32) (uint32, error)
- func ChiudiDB()
- func CountAutori() (uint32, error)
- func CountLibri() (uint32, error)
- func InizializzaDB() (err error)
- func LibriDisponibili() (uint32, error)
- func LibriPrenotati() (uint32, error)
- func RemoveAutore(codice uint32) error
- func RemoveGenere(codice uint32) error
- func RemoveLibro(codice uint32) error
- func RemovePrestito(codice uint32) error
- func SetHash(codice uint32, hash string) error
- func SetRestituzione(libro uint32) error
- type Autore
- type Genere
- type Libro
- type NoCurrentPrestitoError
- type NullPrestito
- type Prestito
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LibriDisponibili ¶
Funzione che ritorna il numero di libri disponibili
func LibriPrenotati ¶
Funzione che ritorna il numero di libri prenotati
func SetRestituzione ¶
Funzione per impostare la restituzione
Types ¶
type Autore ¶
func GetTuttiAutori ¶
Funzione per trovare Autori in base all'iniziale del cognome
func RicercaAutori ¶
Funzione per la ricerca degli autori
type Genere ¶
func RicercaGeneri ¶
Funzione per la ricerca dei generi
type Libro ¶
type Libro struct { Codice uint32 Titolo string NomeAutore string CognomeAutore string Genere string Prenotato bool Hashz string }
Tabelle del database
func RicercaLibri ¶
Funzione per la ricerca dei libri
type NoCurrentPrestitoError ¶
type NoCurrentPrestitoError struct {
// contains filtered or unexported fields
}
func (*NoCurrentPrestitoError) Error ¶
func (e *NoCurrentPrestitoError) Error() string
type NullPrestito ¶
func GetCurrentPrestito ¶
func GetCurrentPrestito(codice uint32) (NullPrestito, error)
Funzione per trovare tutti i prestiti di un utente
type Prestito ¶
type Prestito struct { Codice uint32 Libro uint32 Utente string Data_prenotazione time.Time Durata uint32 Data_restituzione sql.NullTime }
func GetPrestitiLibro ¶
Funzione per trovare tutti i prestiti di un libro
func GetPrestitiUtente ¶
Funzione per trovare tutti i prestiti di un utente
func (Prestito) FormatDataPrenotazione ¶
func (Prestito) FormatDataRestituzione ¶
func (Prestito) FormatScadenza ¶
Click to show internal directories.
Click to hide internal directories.