Documentation ¶
Index ¶
- func CountNotices() int64
- func CreateNotice(ctx context.Context, tp NoticeType, desc string, args ...interface{}) error
- func CreateRepositoryNotice(desc string, args ...interface{}) error
- func DeleteNotice(id int64) error
- func DeleteNotices(start, end int64) error
- func DeleteNoticesByIDs(ids []int64) error
- func DeleteOldSystemNotices(olderThan time.Duration) (err error)
- func RemoveAllWithNotice(ctx context.Context, title, path string)
- func RemoveStorageWithNotice(ctx context.Context, bucket storage.ObjectStorage, title, path string)
- type Notice
- type NoticeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNotice ¶
func CreateNotice(ctx context.Context, tp NoticeType, desc string, args ...interface{}) error
CreateNotice creates new system notice.
func CreateRepositoryNotice ¶
CreateRepositoryNotice creates new system notice with type NoticeRepository.
func DeleteNotice ¶
DeleteNotice deletes a system notice by given ID.
func DeleteNotices ¶
DeleteNotices deletes all notices with ID from start to end (inclusive).
func DeleteNoticesByIDs ¶
DeleteNoticesByIDs deletes notices by given IDs.
func DeleteOldSystemNotices ¶ added in v1.17.0
DeleteOldSystemNotices deletes all old system notices from database.
func RemoveAllWithNotice ¶
RemoveAllWithNotice removes all directories in given path and creates a system notice when error occurs.
func RemoveStorageWithNotice ¶
func RemoveStorageWithNotice(ctx context.Context, bucket storage.ObjectStorage, title, path string)
RemoveStorageWithNotice removes a file from the storage and creates a system notice when error occurs.
Types ¶
type Notice ¶
type Notice struct { ID int64 `xorm:"pk autoincr"` Type NoticeType Description string `xorm:"TEXT"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` }
Notice represents a system notice for admin.
type NoticeType ¶
type NoticeType int
NoticeType describes the notice type
const ( // NoticeRepository type NoticeRepository NoticeType = iota + 1 // NoticeTask type NoticeTask )
Click to show internal directories.
Click to hide internal directories.