This project contains a list of media types (see media folder), and tools to libraries for different languages from those files.
First, you need to install the dependencies:
cd tools
cd generator
go get
go build -o bin/generator
You can get help by running the generator with the --help
flag:
bin/generator --help
To generate a library, run the generator with the language you want to generate for, and the output directory:
bin/generator go --output ~/go/src/github.com/wernerstrydom/go-mediatypes
Contributions are welcome. Please open an issue or a pull request. The media
directory contains the source files for the media types.
It consists of the following fields:
type
: The media typeextensions
: A list of extensions for the media type, if anyregistered
: The date the media type was registered with IANAformat
: The optional format of the media type. For example, you may have a media typeapplication/vnd.example+json
, where the format isapplication/json
.
- Add more languages (only
go
is supported at the moment) - Improve the quality of the data by adding
- file extensions
- removing duplicates
- supporting aliases
MIT
Werner Strydom
This library is based on the following sources: