libris

package
v0.0.0-...-a512109 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package libris defines the Book type, which represents the user's books, and methods to encode books in JSON or CSV.

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,omitempty"`
	Authors        []string `json:"authors,omitempty"`
	Identifier     string   `json:"identifier,omitempty"`
	IdentifierType string   `json:"identifierType,omitempty"`
	//MyRating int64	 `json:"myRating,omitempty"`
	AverageRating float64 `json:"averageRating,omitempty"`
	Publisher     string  `json:"publisher,omitempty"`
	FileType      string  `json:"fileType,omitempty"`
}

Book represents information about a volume.

type Books

type Books []*Book

Books is an alias for a slice of *Book, for methods to hang onto.

func (Books) EncodeCSV

func (bs Books) EncodeCSV(writer io.Writer) error

EncodeCSV writes the given books to the given io.Writer as CSV. Returns all errors found bundled in a single error, or nil if everything went ok.

func (Books) EncodeJSON

func (bs Books) EncodeJSON(writer io.Writer) error

EncodeJSON writes the given books to the given io.Writer as JSON. Returns all errors found bundled in a single error, or nil if everything went ok.

Jump to

Keyboard shortcuts

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