Documentation
¶
Overview ¶
Package Pathbuilder defines Pathbuilder
Package pathbuilder provides the Pathbuilder and related classes
Index ¶
Constants ¶
const DatatypeEmpty = "empty"
Variables ¶
This section is empty.
Functions ¶
func EqualBundles ¶
EqualBundles checks if two bundles are equal. Bundles are equal if they are both nil, or if their machine names are equal.
Types ¶
type Bundle ¶
type Bundle struct {
// Path represents the path of this object
Path
Parent *Bundle // Parent Bundle (if any)
ChildBundles []*Bundle // Children of this Bundle
ChildFields []Field // Fields in this Bundle
// contains filtered or unexported fields
}
Bundle represents a class of objects
func (Bundle) Bundle ¶
Bundle returns the bundle with the given machine name. If such a bundle does not exists, returns nil.
func (Bundle) Bundles ¶
Bundles returns an ordered list of child bundles. Bundles are ordered by their weight.
func (Bundle) Field ¶
Field returns the field with the given id. if the field does not exist, it returns the empty field.
func (Bundle) IsToplevel ¶
IsToplevel checks if this bundle is toplevel
type Path ¶
type Path struct {
ID string // Identifier of this path
UUID string // UUID of this path
Weight int // Display Order in the frontend
Enabled bool // Is the path enabled or not
IsGroup bool // Is this path a group or a field?
GroupID string // Identifier of the group this path belongs to
Bundle string // Identifier of the bundle this path belongs to
Field string // Identifier of the field this path belongs to
FieldType string // Actual Field Type
FieldTypeInformative string // Field type to display to the user
DisplayWidget string // Widget used for display
FormatterWidget string // Widget used for formatting
Cardinality int // Cardinality of this path
PathArray []string // Paths that make up the item
DatatypeProperty string // Datatype property (in case of a field)
Disamb int // index where the path will be disambiguated
Name string // Name of this path
ShortName string // ShortName of this path
Description string // Description of this path
}
Path represents a single path in the Pathbuilder
func (Path) MachineName ¶
MachineName returns the machine name of this path.
The machine name is an identifier that is guaranteed to be unique among the respective bundle, but not globally. If a valid path, the machine name is not the empty string.
func (Path) MakeCardinality ¶
MakeCardinality returns the cardinality to use for a call to make()
type Pathbuilder ¶
type Pathbuilder struct {
// contains filtered or unexported fields
}
Pathbuilder represents a WissKI Pathbuilder
A Pathbuilder consists of an order collection of bundles. A singular bundle can be accessed using it's identifier.
func NewPathbuilder ¶
func NewPathbuilder() Pathbuilder
func (Pathbuilder) Bundle ¶
func (pb Pathbuilder) Bundle(machine string) *Bundle
Bundle returns the main bundle with the given machine name. If such a bundle does not exist, returns nil.
func (Pathbuilder) Bundles ¶
func (pb Pathbuilder) Bundles() []*Bundle
Bundles returns an ordered list of main bundles in this Pathbuilder
func (Pathbuilder) FindBundle ¶
func (pb Pathbuilder) FindBundle(machine string) *Bundle
FindBundle returns the (main or nested) bundle with the given machine name. If such a bundle does not exist, returns nil.
func (Pathbuilder) Get ¶
func (pb Pathbuilder) Get(id string) *Bundle
Get returns the bundle with the given id
func (Pathbuilder) GetOrCreate ¶
func (pb Pathbuilder) GetOrCreate(id string) *Bundle
GetOrCreate either gets or creates a bundle
func (Pathbuilder) Paths ¶
func (pb Pathbuilder) Paths() []Path
Paths recursively returns all paths in this bundle
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dot transforms a pathbuilder into a dot file
|
Package dot transforms a pathbuilder into a dot file |
|
Package pbtxt exports a pathbuilder as text
|
Package pbtxt exports a pathbuilder as text |
|
Package pbxml implements the XML formats for a pathbuilder.
|
Package pbxml implements the XML formats for a pathbuilder. |