Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(base ID, obj interface{})
Register adds a new link between a schema ID and object to the global schema registry. This should be called for all GOBL models that will be included inside schema documents or included in an envelope document payload. The name of the object will be determined from the type of the object provided.
func RegisterAll ¶
func RegisterAll(base ID, objs []interface{})
RegisterAll takes an array of objects to register as additional schema using the ID#Add method. Se `RegistereAllIn` for registering schema using anchors.
func RegisterAllIn ¶
func RegisterAllIn(base ID, objs []interface{})
RegisterAllIn takes the base schema ID and adds all the provided objects as anchored entries in the base.
func RegisterIn ¶
func RegisterIn(base ID, obj interface{})
RegisterIn will determine the anchor and add it to the base schema before adding to the global registry.
func ToSnakeCase ¶
ToSnakeCase converts the provided string into snake case using dashes. This is useful for Schema IDs and definitions to be coherent with common JSON Schema examples.
Types ¶
type ID ¶
type ID string
ID contains the official schema URL.
const ( // UnknownID is provided when the schema has not been registered UnknownID ID = "" )
func (ID) Add ¶
Add appends the provided path to the id, and removes any anchor data that might be there.