repository

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 License: MIT Imports: 12 Imported by: 0

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

Jump to

Keyboard shortcuts

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