activity/tools/vocab/gen
Cory Slep ba40dc50b4 Use *url.URL instead of url.URL.
He who fights with monsters should be careful lest he thereby become a monster.
And if thou gaze long into an abyss, the abyss will also gaze into thee.
2018-05-29 21:57:39 +02:00
..
README.md Migrate vocabulary library to go-fed. 2018-01-24 00:13:06 +01:00
generate.go Migrate vocabulary library to go-fed. 2018-01-24 00:13:06 +01:00
generate_definitions.go Use *url.URL instead of url.URL. 2018-05-29 21:57:39 +02:00
generate_property_definitions.go Use *url.URL instead of url.URL. 2018-05-29 21:57:39 +02:00
util.go Use *url.URL instead of url.URL. 2018-05-29 21:57:39 +02:00
validation.go Migrate vocabulary library to go-fed. 2018-01-24 00:13:06 +01:00

README.md

gen

This library is used to generate the vocab library implementation. Changes to this will fundamentally change the implementation of the vocab library. If custom ActivityStream types are required, no changes to this are required. Instead, the tools/gen/vocab library will need edits.

Creating a static type implementation from the specification is not straightforward due to the following considerations that stem from its roots in JSON-LD:

  • Any property could be an IRI (url.URL)
  • Most properties could be another ActivityStream type (map[string]interface{}) or a value (time.Time, etc)
  • Most properties can have multiple values ([]interface{})
  • In a multiple value scenario, each value could once more be an IRI, another ActivityStream type, or a value

The current generation algorithm leaves ample opportunity for improvements and optimizations.