Libraries¶
A Go library returns a *runtime.Library.
func Library() *runtime.Library {
return &runtime.Library{
Name: "files",
Description: "File resources.",
Resources: map[string]runtime.ResourceRegistration{
"file": runtime.MakeResource[File, *FileOutput, runtime.NoConfig](),
},
}
}
The main fields are:
NameandDescriptionfor human-readable metadata.Configurationfor an optional library configuration schema.Resources,DataSources, andActionsfor primitive node types.Functionsfor inline expression functions.ResourceComposites,DataComposites, andActionCompositesfor generated UB libraries.
The compiler assigns the resolved library path. Library authors register the types; factory source chooses the import alias.
A factory imports the library and calls a registered type with alias.type: