Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct { Read []string `bson:"read" json:"read"` Write []string `bson:"write" json:"write"` }
ACL for categories.
type Categories ¶
type Categories []Category
Categories list.
func (Categories) CheckWrite ¶
func (slice Categories) CheckWrite(fn func([]string) bool) Categories
CheckWrite permissions for categories tree.
func (Categories) Len ¶
func (slice Categories) Len() int
func (Categories) Less ¶
func (slice Categories) Less(i, j int) bool
func (Categories) Swap ¶
func (slice Categories) Swap(i, j int)
type Category ¶
type Category struct { ID bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` Name string `bson:"name" json:"name"` Description string `bson:"description" json:"description"` Slug string `bson:"slug" json:"slug"` Color string `bson:"color" json:"color"` Permissions ACL `bson:"permissions" json:"-"` Parent bson.ObjectId `bson:"parent,omitempty" json:"parent,omitempty"` ReactSet []string `bson:"reactSet" json:"-"` Order int `bson:"order,omitempty" json:"order,omitempty"` // Runtime computed properties. Child Categories `bson:"-" json:"subcategories,omitempty"` Writable bool `bson:"-" json:"writable"` Reactions []string `bson:"-" json:"reactions,omitempty"` }
Category model.
Click to show internal directories.
Click to hide internal directories.