Sign inSign up

majest/gister

By majest

•Updated over 3 years ago

Gister is a simple tool allowing to list public gists in github by user name

Image
0

271

majest/gister repository overview

⁠Gister

Github Url:

github.com/majest/gister⁠

⁠Application for listing user's public gists

It allows to specify user's id by which the public gists should be limited. By default there is a pagination parameters that limit the page size to 20. The application is stateful which means it will recognise the user id and display only the new gists which were added since the last run. It uses sqlite to store the state.

⁠Install

Using go

go install github.com/majest/gister

⁠Usage

USAGE:
    [global options] command [command options] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --token value  Github API Token. Required before running any operations [$TOKEN]
   --limit value  Gits per page limit (default: "20") [$LIMIT]
   --page value   Page number (default: "0") [$PAGE]
   --reset        Reset the last saved date for the specific user [$RESET]
   --help, -h     show help

⁠How to run

./gister -limit 4 -page 2 majest - displays second page, limit 4 per page for user majest

./gister majest - displays second page, limit 4 per page for user majest

./gister -reset majest - reset the last time and display default page limit 20 and page for majest

./gister -reset majest - reset the last time and display default page limit 20 and page for majest

./gister -since 2018-01-12T11:45:26.371Z -page 2 -limit 2 majest - display all gists since 2018-01-12T11:45:26.371Z limit 2, page 2 for user majest

⁠Docker

docker run -e LOG_LEVE=debug majest/gister:latest majest

⁠Build for docker

task build-docker - build docker image. When running docker it's a good idea to use volume to /app directory as it will persist the sqlite database

gister:/app

docker volume create gister
docker run -v gister:/app  gister -token xxx majest  

⁠Development

⁠Taskfile

Gister provides number of tasks related to compilation and SQLC migrations using Task file (similar to makefile but nicer) - https://taskfile.dev/installation/⁠

Install Taskfile

  • on Macos: brew install go-task/tap/go-task
  • Linux: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d

All available tasks can be displayed running task -l

⁠SQLc

SQLc is used to manage the migrations and compiles the DAO objects for the application. Follow the instructions available at https://docs.sqlc.dev/en/stable/overview/install.html to install SQLC

run sqlc generate to regenerate sql

⁠Migrations

To migrate the database to new version add a new file in sqlc/migrations on the format YYYMMDDHHMM.sql

⁠Debug

Use LOG_LEVEL environment variable to control the logging level. For example: LOG_LEVEL=debug ./gister majest or docker run -e LOG_LEVEL=debug gister majest

Tag summary

Content type

Image

Digest

sha256:3a6e768c8…

Size

251.3 MB

Last updated

over 3 years ago

docker pull majest/gister