Documentation
¶
Index ¶
- Constants
- Variables
- func DeletePaste(db *badger.DB, slug Slug) error
- func FindPaste(db *badger.DB, slug Slug) (*pastebin_record.PastebinRecord, error)
- func KeepalivePastebin(db *badger.DB, slug Slug, newExpiry time.Time) error
- func LookupPastebin(db *badger.DB, slug Slug) (string, error)
- func OpenDb() *badger.DB
- func RunMaintenance(db *badger.DB) error
- type Slug
Constants ¶
View Source
const MAX_PASTEBIN_BYTES int = 10 << 20
Variables ¶
Functions ¶
func FindPaste ¶
func FindPaste(db *badger.DB, slug Slug) (*pastebin_record.PastebinRecord, error)
func KeepalivePastebin ¶
/ KeepalivePastebin issues a new expiration for a pastebin.
func RunMaintenance ¶
/ RunMaintenance maintains integrity of the storage, including removing expired pastes.
Types ¶
type Slug ¶
type Slug string
func GenerateTextSlug ¶
func GenerateTextSlug(pb *pastebin_record.PastebinRecord) Slug
/ GenerateTextSlug uniquely encodes a body of bytes into a short string identifier.
func StoreNewPaste ¶
func StoreNewPaste(db *badger.DB, record *pastebin_record.PastebinRecord) (Slug, error)
Click to show internal directories.
Click to hide internal directories.