sodago

command module
v0.0.0-...-6748d2a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 21 Imported by: 0

README

sodago

sodago is an implementation of a subset of the soda4LCA API. It is not intended to be used in production but only for testing purposes. However, it comes with a very fast server and is trivial to set up which makes it a fun tool when developing/testing against the soda4LCA service API in openLCA or the EPD Editor.

Usage

sodago is written in Go and compiles to a single binary:

cd sodago
go build  # compile it
./sodago  # run it

Data storage

All data are stored as plain files in the data folder. Within this folder the content of each data stock is stored in a sub-folder. The name of the data stock is the name of this sub-folder and the UUID of the data stock is stored in a file .stock in that folder. Additionally, the content of a data stock is stored in the index.json file. The data sets are stored under their respective paths in the data folder (flows in flows, processes in processes etc.). The file name of a data set is simply <uuid>_<version>.xml.

External documents of sources are stored under external_docs/<source uuid>/<file>. Profiles are stored in the sub-folder profiles of the data directory. Thus, you should not name a data stock profiles. Each profile is stored in a separate JSON file where the name has the following pattern: <profile ID>.json

Implemented service routes

The prefix /resource is always added to all service routes (as in soda4LCA):

  • GET /datastocks
  • GET /profiles
  • GET /profiles/{id}
  • /authenticate/login (returns always OK!)
  • GET [/datastocks/{datastock}]/{path}
  • GET [/datastocks/{datastock}]/{path}/{id}[?version={version}]
  • GET [/datastocks/{datastock}]/sources/{id}/{file}
  • POST /{path}
  • POST /sources/withBinaries

TODO:

  • implement: GET /sources/{uuid}/digitalfile
  • put types to lower case (e.g. Version)
  • normalize versions (1 == 1.00 == 1.00.000)
  • simple search
  • LCIA methods

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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