Documentation ¶
Overview ¶
Package cli is a facade to the gutenfinder package that implements the behaviour needed for the Gutenfinder CLI application.
Index ¶
- type CLI
- type Catalogue
- func (catalogue Catalogue) LinkAuthors(ctx context.Context) error
- func (catalogue Catalogue) LoadText(ctx context.Context) error
- func (catalogue Catalogue) LoadXML(ctx context.Context) error
- func (catalogue Catalogue) ScanXML(ctx context.Context) error
- func (catalogue Catalogue) Search(ctx context.Context) error
- type CatalogueParameters
- type DB
- type DBParameters
- type Elastic
- type ElasticParameters
- type Parameters
- type SearchResult
- type SearchResultParameters
- type Web
- type WebParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct { Catalogue Catalogue `inject:"inline"` DB DB `inject:"inline"` Elastic Elastic `inject:"inline"` Web Web `inject:"inline"` SearchResult SearchResult `inject:"inline"` }
CLI is the command line interface for Gutenfinder.
func (*CLI) SetParameters ¶
func (cli *CLI) SetParameters(parameters *Parameters) error
SetParameters applies the given parameters to all the CLI subcommands.
type Catalogue ¶
type Catalogue struct {
Parameters *Parameters `inject:""`
}
Catalogue is a CLI subcommand for interacting with the Gutenfinder catalogue.
func (Catalogue) LinkAuthors ¶
LinkAuthors creates and updates authors from EBook properties.
func (Catalogue) LoadXML ¶
LoadXML loads all EBooks described by the Project Gutenberg .rdf catalogue data files into the database.
type CatalogueParameters ¶
type CatalogueParameters struct { RDFRoot string MirrorRoot string MaxOpenFiles int64 ForceIndex bool IndexWorkers int IndexBulkActions int IndexBulkSize int }
CatalogueParameters are the CLI parameters for the Catalogue CLI subcommand.
type DB ¶
type DB struct {
Parameters *Parameters `inject:""`
}
DB is the CLI subcommand for interacting with the database.
type DBParameters ¶
type DBParameters struct { MigrateDatabaseName string MigrateSourceURL string MigrationsTable string MigrateDown bool MigrateDrop bool MigrateVersion uint }
DBParameters are parameters for the DB subcommand.
type Elastic ¶
type Elastic struct {
Parameters *Parameters `inject:""`
}
Elastic is the CLI subcommand to interact with Elasticsearch.
type ElasticParameters ¶
type ElasticParameters struct {
SearchField string
}
ElasticParameters are parameters for the Elastic CLI subcommand.
type Parameters ¶
type Parameters struct { Input io.Reader `inject:""` Output io.Writer `inject:""` PostgresConnection string ElasticURL string SearchTerm string CatalogueParameters ElasticParameters DBParameters WebParameters SearchResultParameters }
Parameters represents the CLI parameters for Gutenfinder.
type SearchResult ¶
type SearchResult struct {
Parameters *Parameters `inject:""`
}
SearchResult is the CLI subcommand for interacting with saved Search Results.
type SearchResultParameters ¶
type SearchResultParameters struct { }
SearchResultParameters are the parameters for the SearchResult subcommand.
type Web ¶
type Web struct {
Parameters *Parameters `inject:""`
}
Web is the CLI subcommand for interacting with the internet over HTTP.
type WebParameters ¶
WebParameters are parameters for the Web subcommand.