models

package
v3.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name string `json:"name,omitempty"`
	ID   string `json:"id,omitempty"`
}

Author represents a book author

func (*Author) GetID

func (a *Author) GetID() string

GetID gets the id of the Author

func (*Author) GetName

func (a *Author) GetName() string

GetName gets the name of the Author

type Book

type Book struct {
	ID          string    `json:"id"`
	Title       string    `json:"title"`
	Author      *Author   `json:"author,omitempty"`
	Publisher   string    `json:"publisher,omitempty"`
	Description string    `json:"description,omitempty"`
	Series      *Series   `json:"series,omitempty"`
	Filepath    string    `json:"filepath"`
	HasCover    bool      `json:"hascover"`
	ModTime     time.Time `json:"modtime,omitempty"`
	FileType    string    `json:"filetype,omitempty"` // Does not include leading period
}

Book is a book.

func NewBook

func NewBook(title, author, publisher, seriesName string, seriesIndex float64, description, filepath string, hascover bool, modtime time.Time, filetype string) *Book

NewBook creates a new book

type NameID

type NameID interface {
	GetName() string
	GetID() string
}

NameID represents a name and an id

type Series

type Series struct {
	Name  string  `json:"name,omitempty"`
	ID    string  `json:"id,omitempty"`
	Index float64 `json:"index,omitempty"`
}

Series represents a book series

func (*Series) GetID

func (s *Series) GetID() string

GetID gets the id of the Series

func (*Series) GetName

func (s *Series) GetName() string

GetName gets the name of the Series

Jump to

Keyboard shortcuts

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