dujour

module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MPL-2.0

README

Dujour

A JSON/CSV Data File Server

GitHub go.mod Go version Go Report Card DeepSource GitHub Workflow Status GitHub Workflow Status (branch)

GitHub Release Date GitHub commits since latest release (by date) GitHub

About

Dujour is a JSON/CSV data file server. It supports any usecase in which simple transformation of JSON and CSV data to a web consumable JSON REST API is a requirement.

Releases

You can find the latest software here.

Features
  • Automatic self-signed TLS certificate (or use your own)
  • Supports CSV files. Application will parse them to JSON
  • Supports any number of JSON or CSV data files, memory being the only constraint
  • Hot reload. New or edited data can be added with no server restart needed
  • Data is served from memory. Fast
Usage

Add .json and .csv data files to the data directory and Dujour will automatically load, validate and serve each data file at two REST API endpoints in JSON format.

In each data file, element/row data should contain an id key/column which should be unique in the dataset.

Data is loaded and served from an in-memory cache. No restart of the server is required when adding new data. Adding a new file of same name will cause the cache to be cleared and the data reloaded.

The filename of each data file determines the API endpoints which are created. For example, for a file named users.json (not case sensitive), Dujour will serve data at two endpoints:-

Get all users

This endpoint will retrieve all users:

GET $serverUrl:18651/users
Get a specific user

This endpoint will retrieve a specific user:

GET $serverUrl:18651/users/$id
Installation

Grab the tar.gz or zip archive for your OS from the releases page.

Unpack it to the target host, and then start the server!

To update, stop the server, replace the binary, start the server.

Limitations

Dujour does not perform mutations on the data files. Only GET operations are supported.

Development Opportunities
  • Support CRUD operations on the data
  • Run the application as a service
License

Licensed under Mozilla Public License 2.0

Directories

Path Synopsis
cmd
certificate
Package certificate provides code to create and write a self-signed TLS certificate
Package certificate provides code to create and write a self-signed TLS certificate
file
Package file performs operations related to file discovery, validation, conversion and load to the cache
Package file performs operations related to file discovery, validation, conversion and load to the cache
routes
Package routes contains all the handlers used in the application
Package routes contains all the handlers used in the application
watcher
Package watcher monitors a data folder and performs automatic reloading of data including updating the datasource cache in memory for deleted and edited data files
Package watcher monitors a data folder and performs automatic reloading of data including updating the datasource cache in memory for deleted and edited data files

Jump to

Keyboard shortcuts

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