Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct { GenRoot *gen.PackageManager PackagePolicy PackagePolicy // contains filtered or unexported fields }
Converter is responsible for taking the intermediate RDF understanding of one or more ActivityStreams-based specifications and converting it into a series of code-generated files.
It supports generating code in two different styles, which greatly affects the package imports that application developers will use in their applications. While both are available, this results in code that may not be able to be built on some systems due to the compilation memory requirements. Therefore, final tooling is ecouraged to pick one and only one to use as there is no need for another dimension of code fragmentation. These styles are dicatated by the Converter's PackagePolicy.
The generated code is separated into three locations: a "values" series of subdirectories, the subdirectories for the ActivityStream specification, and the "root" generated package.
The "root" package is indended to be the sole package that all application developers use for non-interface types. It contains free-functions that aid in navigating the ActivityStreams hierarchy (such as extends and disjoints). It also contains a Resolver for deserialization or type dispatching.
The specifications' generated code contains both interfaces and implementations. Developers' applications should only rely on the interfaces, which are used internally anyway.
type File ¶
type File struct { // F is the code-generated contents of this file. F *jen.File // FileName is the name of this file to write. FileName string // Directory specifies the location to write this file. Directory string }
File is a code-generated file.
type PackagePolicy ¶
type PackagePolicy int
PackagePolicy governs what file directory structure to generate files in. Only affects types and properties in a vocabulary. Does not affect values.
const ( // FlatUnderRoot puts all types and properties together for each // vocabulary. FlatUnderRoot PackagePolicy = iota // IndividualUnderRoot puts each type and each property into their own // package within each vocabulary. IndividualUnderRoot )