Documentation
¶
Index ¶
- Variables
- func DeleteHypha(u *user.User, h *hyphae.Hypha) (hop *history.HistoryOp, errtitle string)
- func FetchTextPart(h *hyphae.Hypha) (string, error)
- func RenameHypha(h *hyphae.Hypha, newHypha *hyphae.Hypha, recursive bool, u *user.User) (hop *history.HistoryOp, errtitle string)
- func SetHeaderLinks()
- func UnattachHypha(u *user.User, h *hyphae.Hypha) (hop *history.HistoryOp, errtitle string)
- func UploadBinary(h *hyphae.Hypha, mime string, file multipart.File, u *user.User) (*history.HistoryOp, string)
- func UploadText(h *hyphae.Hypha, data []byte, message string, u *user.User) (hop *history.HistoryOp, errtitle string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CanDelete = canFactory( rejectDeleteLog, "delete-confirm", nil, "Not enough rights to delete, you must be a moderator", "Cannot delete this hypha because it does not exist", true, ) CanRename = canFactory( rejectRenameLog, "rename-confirm", nil, "Not enough rights to rename, you must be a trusted editor", "Cannot rename this hypha because it does not exist", true, ) CanUnattach = canFactory( rejectUnattachLog, "unattach-confirm", func(h *hyphae.Hypha, u *user.User) (errmsg, errtitle string) { if h.BinaryPath == "" { rejectUnattachLog(h, u, "no amnt") return "Cannot unattach this hypha because it has no attachment", "No attachment" } return "", "" }, "Not enough rights to unattach, you must be a trusted editor", "Cannot unattach this hypha because it does not exist", true, ) CanEdit = canFactory( rejectEditLog, "upload-text", nil, "You must be an editor to edit a hypha", "You cannot edit a hypha that does not exist", false, ) CanAttach = canFactory( rejectAttachLog, "upload-binary", nil, "You must be an editor to attach a hypha", "You cannot attach a hypha that does not exist", false, ) )
Functions ¶
func DeleteHypha ¶
DeleteHypha deletes hypha and makes a history record about that.
func FetchTextPart ¶
FetchTextPart tries to read text file of the given hypha. If there is no file, empty string is returned.
func RenameHypha ¶
func RenameHypha(h *hyphae.Hypha, newHypha *hyphae.Hypha, recursive bool, u *user.User) (hop *history.HistoryOp, errtitle string)
RenameHypha renames hypha from old name `hyphaName` to `newName` and makes a history record about that. If `recursive` is `true`, its subhyphae will be renamed the same way.
func SetHeaderLinks ¶
func SetHeaderLinks()
func UnattachHypha ¶
UnattachHypha unattaches hypha and makes a history record about that.
func UploadBinary ¶
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.