pkg/

directory
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: AGPL-3.0

README

magnetico/pkg

GoDoc

  • The most significant package is persistence, that abstracts access to the magnetico databases with different engines (currently, SQLite, stdout and partly PostgreSQL).

For REST-ful magneticow API, see https://app.swaggerhub.com/apis/boramalper/magneticow-api/.

PostgreSQL database engine (only magneticod part implemented)

PostgreSQL database engine uses PostgreSQL to store indexed torrents. It's more performant and flexible than SQLite but requires additional software configuration.

WARNING: pg_trgm extension required. You need to enable it for your database before starting magneticod:

CREATE EXTENSION pg_trgm;

Engine usage example:

magneticod --database=postgres://username:password@127.0.0.1:5432/database?schema=custom_schema_name&sslmode=disable

See pgx repository for more examples.

Optional parameter schema was added to choose which schema will be used to store magnetico tables, sequences and indexes.

Stdout Dummy Database Engine for magneticod

Stdout dummy database engine for magneticod prints a new JSON Line for each discovered torrent so that you can pipe the stdout of magneticod into some other program to build your own pipelines on the fly!

Example Output

{"infoHash":"f84b51f0d2c3455ab5dabb6643b4340234cd036e","name":"Big_Buck_Bunny_1080p_surround_frostclick.com_frostwire.com","files":[{"size":928670754,"path":"Big_Buck_Bunny_1080p_surround_FrostWire.com.avi"},{"size":5008,"path":"PROMOTE_YOUR_CONTENT_ON_FROSTWIRE_01_06_09.txt"},{"size":3456234,"path":"Pressrelease_BickBuckBunny_premiere.pdf"},{"size":180,"path":"license.txt"}]}

WARNING:

Please beware that the schema of the object (dictionary) might change in backwards-incompatible ways in the future; although I'll do my best to ensure it won't happen.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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