LRP-tool

command module
v0.0.0-...-c1fd308 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

LRP-tool

Learning resources parser tool.

How to usage?

Global options
How to configure logger

For now have only to options that can be used for the logger configuration:

  1. Set logger level thought set the parameter lrpt --log-level=[panic|fatal|error|warn|info|debug|trace] ... or using APP_LOG_FORMATTER_JSON environment variable.
  2. Set logger formatter like JSON thought set the parameter lrpt --json ... or using APP_LOG_FORMATTER_JSON environment variable.
Parser
How to run parser

To run parser with a known configuration lrpt parser run

How to run parser and store parsing results to the Dummy database

To use the Dummy database as a storage engine needed to set up a running flag or environment.

  • flag example lrpt parser run --storage.dummy
  • environment example APP_STORAGE_DUMMY=true
How to run parser and store parsing results to the PostgreSQL database

To use the PostgreSQL database as a storage engine, a connection URL setup needed. This can be in two ways as usual. The first-way is adding a service running option that contains PostgreSQL connection DSN like the example below lrpt parser run --storage.postgresql=postgresql://postgres:password@localhost:5432/parser. The second-way is to set up the environment variable APP_STORAGE_POSTGRESQL_DSN that contains PostgreSQL connection DSN to the application running environment.

How to inspect a known configuration

To inspect a known configuration run tool with the next commandlrpt parser inspect.

How to import a configuration from xlsx file

To import all configuration files from ./business/categories to ./config/project run lrpt config import command.

Used libraries

  • github.com/urfave/cli/v2 - Console command framework
  • github.com/sirupsen/logrus - Power logger library
  • github.com/jszwec/csvutil - CSV marshal/unmarshal
  • github.com/gocolly/colly/v2 - Lightning Fast and Elegant Scraping Framework for Gophers
  • github.com/stretchr/testify - Framework for testing
  • github.com/jackc/pgx/v4 - PostgreSQL Driver and Toolkit
  • github.com/360EntSecGroup-Skylar/excelize/v2 - Excel processor

Writing with love in Golang!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd

Jump to

Keyboard shortcuts

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