mea-libris: github.com/hanjos/mea-libris/libris Index | Files

package libris

import "github.com/hanjos/mea-libris/libris"

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

Index

Package Files

books.go

type Book Uses

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 Uses

type Books []*Book

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

func (Books) EncodeCSV Uses

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 Uses

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.

Package libris imports 5 packages (graph) and is imported by 1 packages. Updated 2016-12-14. Refresh now. Tools for package owners.