Documentation ¶
Overview ¶
contains data structures that describe content in a repository
Index ¶
- Constants
- type Item
- type Node
- type RepoNode
- func (n *RepoNode) AddNode(name string, childNode *RepoNode) *RepoNode
- func (n *RepoNode) CanBeAccessedByGroups(groups []string) bool
- func (n *RepoNode) GetParent() *RepoNode
- func (n *RepoNode) GetPath(dataFields []string) []*Item
- func (n *RepoNode) InPath(path []*Item) bool
- func (n *RepoNode) IsOneOfTheseMimeTypes(mimeTypes []string) bool
- func (n *RepoNode) PrintNode(id string, level int)
- func (n *RepoNode) ToItem(dataFields []string) *Item
- func (n *RepoNode) WireParents()
- type SiteContent
- type Status
Constants ¶
View Source
const ( // Indent for json indentation Indent string = "\t" // PathSeparator separator for paths in URIs PathSeparator = "/" )
View Source
const ( // StatusOk we found content StatusOk Status = 200 // StatusForbidden we found content but you mst not access it StatusForbidden = 403 // StatusNotFound we did not find content StatusNotFound = 404 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { ID string `json:"id"` Name string `json:"name"` URI string `json:"URI"` MimeType string `json:"mimeType"` Hidden bool `json:"hidden,omitempty"` Data map[string]interface{} `json:"data"` Groups []string `json:"groups"` }
Item on a node in a content tree - "payload" of an item
type Node ¶
type Node struct { Item *Item `json:"item"` Nodes map[string]*Node `json:"nodes"` Index []string `json:"index"` }
Node a node in a content tree
type RepoNode ¶
type RepoNode struct { ID string `json:"id"` // unique identifier - it is your responsibility, that they are unique MimeType string `json:"mimeType"` // well a mime type http://www.ietf.org/rfc/rfc2046.txt LinkID string `json:"linkId"` // (symbolic) link/alias to another node Groups []string `json:"groups"` // which groups have access to the node, if empty everybody has access to it URI string `json:"URI"` Name string `json:"name"` Hidden bool `json:"hidden"` // hidden in content.nodes, but can still be resolved when being directly addressed DestinationID string `json:"destinationId"` // if a node does not have any content like a folder the destinationIds can point to nodes that do aka. the first displayable child node Data map[string]interface{} `json:"data"` // what ever you want to stuff into it - the payload you want to attach to a node Nodes map[string]*RepoNode `json:"nodes"` // child nodes Index []string `json:"index"` // defines the order of the child nodes // contains filtered or unexported fields }
RepoNode node in a content tree
func (*RepoNode) CanBeAccessedByGroups ¶
CanBeAccessedByGroups can this node be accessed by at least one the given groups
func (*RepoNode) IsOneOfTheseMimeTypes ¶
IsOneOfTheseMimeTypes is the node one of the given mime types
func (*RepoNode) WireParents ¶
func (n *RepoNode) WireParents()
WireParents helper method to reference from child to parent in a tree recursively
type SiteContent ¶
type SiteContent struct { Status Status `json:"status"` URI string `json:"URI"` Dimension string `json:"dimension"` MimeType string `json:"mimeType"` Item *Item `json:"item"` Data interface{} `json:"data"` Path []*Item `json:"path"` URIs map[string]string `json:"URIs"` Nodes map[string]*Node `json:"nodes"` }
SiteContent resolved content for a site
Source Files ¶
Click to show internal directories.
Click to hide internal directories.