An open API service indexing awesome lists of open source software.

https://github.com/dmolik/githubfs

A weird little C program to fetch your stared repos and mount to a directory
https://github.com/dmolik/githubfs

c github graphql libcurl libfastjson libfuse lmdb

Last synced: 7 months ago
JSON representation

A weird little C program to fetch your stared repos and mount to a directory

Awesome Lists containing this project

README

          

# GitHubFS

I got curious over the weekend and wonder what it would be like to query the GitHub API in C using [libCurl](https://curl.haxx.se/libcurl/). I quickly realized I was going to need a JSON parser, so I reached for [libfastjson](https://github.com/rsyslog/libfastjson), which is a fork of json-c brought to us by the rsyslog folks.

The project has evolved! it now mounts a full list of your stared repos to a directory of your choosing using [Fuse](https://github.com/libfuse/libfuse).

The code has now been refactored to use [LMDB](https://symas.com/lmdb/) for persistence, and Repo access.

## Prerequisites

You're going to need a; Compiler, Make of some sort, libfastjson with headers, and libcurl with it's headers, libfuse, and now lmdb with it's headers.

## Building

All you need to do is run:

make

## Running

The fetcher needs two environment variables `GH_USER`; your github username, and `GH_TOKEN`; a personal access token to your public repos. Execution might look something like this:

export GH_USER=dmolik
export GH_TOKEN=
./githubfs

For example:

> export GH_USER=dmolik
> export GH_TOKEN=example123
> ./githubfs t

> githubfs t
t
├── aalhour
│   └── awesome-compilers
├── acassen
│   └── keepalived
├── adapta-project
│   └── adapta-gtk-theme
├── admiraltyio
│   └── multicluster-scheduler
└── AidoP
   └── Skypaper

> cat t/acassen/keepalived
URL: git@github.com:acassen/keepalived.git
Description: Keepalived