Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Initialize = &cli.Command{
Name: "init",
Usage: "initializes eBook repository",
ArgsUsage: "",
Action: initRepository,
}
Initialize is the entry point for cli.v2 as the init command
View Source
var Process = &cli.Command{
Name: "run",
Usage: "run synchronization of eBook repository",
ArgsUsage: "",
Action: process,
}
Process is the entry point for cli.v2 of the run command
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct { Username string `json:"username"` Password string `json:"password"` Directory string `json:"content_directory"` Format string `json:"format"` // contains filtered or unexported fields }
Repository represents the configuration of the current repository
func LoadFromFile ¶
func LoadFromFile(filename string) (*Repository, error)
LoadFromFile will create a Repository object from filename
func (*Repository) Authenticate ¶
func (repo *Repository) Authenticate() error
Authenticate will authenticate against packtpub and fetch cookies
func (*Repository) CreateBookDirectory ¶
func (repo *Repository) CreateBookDirectory() error
CreateBookDirectory will create the directory structure to store the book collection
func (*Repository) DownloadBooks ¶
func (repo *Repository) DownloadBooks(format string)
DownloadBooks will process the library and download books in the specified "format"
func (*Repository) LoadFromConfig ¶
func (repo *Repository) LoadFromConfig(filename string) error
LoadFromConfig setsup the repository based on the configuration file passed as filename
func (*Repository) SaveToFile ¶
func (repo *Repository) SaveToFile(filename string) error
SaveToFile will serialize the configuration to disk
Click to show internal directories.
Click to hide internal directories.