Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddLeafProps ¶
AddLeafProps are the leaf creation arguments for the AddLeaf method
type Branch ¶
type Branch struct { db.M `bson:",inline"` // The titles of this branch // At least one title should be set Titles []string `bson:"title" json:"titles,omitempty"` // The kind of title // In the data we import there are 2 kinds of titles // One that contains a job name // And one that contains a Sector name TitleKind TitleKind `bson:"titleKind" json:"titleKind"` // Branches contains sub branches ontop of this branch Branches []primitive.ObjectID `json:"branchesIds,omitempty"` // ParsedBranches can be set when building a tree that is send to a user over the api in JSON format ParsedBranches []*Branch `bson:"-" json:"branches,omitempty"` // Used by the tree to find the root branches HasParents bool `json:"-" bson:"-"` }
Branch contains a branch of the matcher tree
func FindParents ¶
FindParents find the branchs that have the id arg as parent
func (*Branch) AddLeaf ¶
func (b *Branch) AddLeaf(dbConn db.Connection, props AddLeafProps, injectIntoSource bool) (*Branch, error)
AddLeaf adds a new branch to
func (*Branch) CollectionName ¶
CollectionName implements db.Entry
func (*Branch) Update ¶
func (b *Branch) Update(dbConn db.Connection, props AddLeafProps) error
Update updates a spesific branches data
type TitleKind ¶
type TitleKind uint8
TitleKind defines the kind of the title
func (TitleKind) JSONSchemaDescribe ¶
func (TitleKind) JSONSchemaDescribe() jsonschema.Property
JSONSchemaDescribe implements jsonschema.Describe
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree contains the cache for the tree so tree resolution can be fast
func (*Tree) GetIDsForBranch ¶
func (tc *Tree) GetIDsForBranch(dbConn db.Connection, branchID primitive.ObjectID) ([]primitive.ObjectID, error)
GetIDsForBranch returns a spesific branches child branches their ids
Click to show internal directories.
Click to hide internal directories.