activity/tools/vocab/gen
Cory Slep c655c635ff Add IsPublic to vocab.Object types & subtypes.
The IsPublic method will return 'true' if the special public collection
defined in the ActivityPub spec is addressed in the 'to', 'bto' 'cc', or
'bcc' properties of the Object or any of the types extending from them.
2018-08-04 15:20:34 +02:00
..
README.md
generate.go Remove duplicate intermediate types. 2018-06-17 18:51:30 +02:00
generate_definitions.go Add IsPublic to vocab.Object types & subtypes. 2018-08-04 15:20:34 +02:00
generate_property_definitions.go Remove duplicate intermediate types. 2018-06-17 18:51:30 +02:00
util.go
validation.go

README.md

gen

This library is used to generate the go-fed/activity/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 go-fed/activity/tools/defs 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.