Documentation
¶
Overview ¶
Package shroom provides utilities for hypha manipulation.
Some of them are wrappers around functions provided by package hyphae. They manage history for you.
Index ¶
- Variables
- func Delete(u *user.User, h hyphae.ExistingHypha) error
- func RemoveMedia(u *user.User, h *hyphae.MediaHypha) error
- func Rename(oldHypha hyphae.ExistingHypha, newName string, recursive bool, ...) error
- func SetHeaderLinks()
- func UploadBinary(h hyphae.Hypha, mime string, file multipart.File, u *user.User) error
- func UploadText(h hyphae.Hypha, data []byte, userMessage string, u *user.User) error
- func YieldHyphaNamesContainingString(query string) <-chan string
Constants ¶
This section is empty.
Variables ¶
var ( CanEdit = canFactory( rejectEditLog, "upload-text", nil, "ui.act_norights_edit", "You cannot edit a hypha that does not exist", false, ) CanAttach = canFactory( rejectUploadMediaLog, "upload-binary", nil, "ui.act_norights_media", "You cannot attach a hypha that does not exist", false, ) )
CanDelete and etc are hyphae operation checkers based on user rights and hyphae existence.
Functions ¶
func Delete ¶ added in v1.9.0
func Delete(u *user.User, h hyphae.ExistingHypha) error
Delete deletes the hypha and makes a history record about that.
func RemoveMedia ¶ added in v1.9.0
func RemoveMedia(u *user.User, h *hyphae.MediaHypha) error
RemoveMedia removes media from the media hypha and makes a history record about that. If it only had media, the hypha will be deleted. If it also had text, the hypha will become textual.
func Rename ¶ added in v1.9.0
func Rename(oldHypha hyphae.ExistingHypha, newName string, recursive bool, leaveRedirections bool, u *user.User) error
Rename renames the old hypha to the new name and makes a history record about that. Call if and only if the user has the permission to rename.
func SetHeaderLinks ¶
func SetHeaderLinks()
SetHeaderLinks initializes header links by reading the configured hypha, if there is any, or resorting to default values.
func UploadBinary ¶
UploadBinary edits the hypha's media part and makes a history record about that.
func UploadText ¶
UploadText edits the hypha's text part and makes a history record about that.
func YieldHyphaNamesContainingString ¶ added in v1.3.0
YieldHyphaNamesContainingString picks hyphae with have a string in their title, sorts and iterates over them in alphabetical order.
Types ¶
This section is empty.