Virgil
Virgil told the tales of Orpheus and Eurydice.
virgil
is a package defining the Orphic response format used by Eris. It’s
separated out to provide a lightweight library with no dependencies.
JSON Format
Virgil JSON messages follow the format:
{
"data": [
[
"heading 1", "heading 2"
],
[
["item 1", "item 2"],
["item a", "item b"]
]
],
"messages": [
{
"type": "success",
"text": "message",
"fields": {
"key": "value"
}
}
]
}
Both data
and messages
can be null
, although typically there will always
be at least one entry in messages
.
Each section of data
can have 1 or more columns and 0 or more rows. Each row
will have the same number of columns as defined in the headings. The headings
are always strings, the data itself can be any value.
Each message in messages
will contain a string type
(one of success
,
failure
, info
, warn
or error
), a string text
message and 0 or more
fields
with a string key
and arbitrary typed value
.