Documentation
¶
Index ¶
- func BurnPaste(app *config.Application, id string) error
- func ConnectDB(app *config.Application)
- func LinkIDExists(app *config.Application, id string) bool
- func NewDrop(app *config.Application, id string, title string, filename string) error
- func NewLink(app *config.Application, id string, completeLink string) error
- func NewPaste(app *config.Application, id string, title string, content string, ...) error
- type FileDrop
- type Paste
- type ShortenedLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BurnPaste ¶
func BurnPaste(app *config.Application, id string) error
BurnPaste removes a paste with given ID
func ConnectDB ¶
func ConnectDB(app *config.Application)
func LinkIDExists ¶
func LinkIDExists(app *config.Application, id string) bool
LinkIDExists returns true when id exists
Types ¶
type FileDrop ¶
type FileDrop struct {
ID string `db:"id"`
Title string `db:"title"`
Created string `db:"created"`
FileName string `db:"filename"`
Preview string
}
FileDrop is struct to resemble 'file_drops' table
type Paste ¶
type Paste struct {
ID string `db:"id"`
Title string `db:"title"`
Content string `db:"content"`
Password string `db:"password"`
Preview string // One of `markdown`, `code` and `plain`.
PreviewLanguage string // Code preview language extension.
ContentHTML template.HTML
Expiry string `db:"expiry"`
Created string `db:"created"`
Burn int `db:"burn"`
}
Paste symbolizes a single paste
type ShortenedLink ¶
type ShortenedLink struct {
ID string `db:"id"`
CompleteLink string `db:"complete_link"`
Created string `db:"created"`
}
ShortenedLink is struct to resemble 'shortened_links' table
func GetLink ¶
func GetLink(app *config.Application, id string) (ShortenedLink, error)
GetLink is the db operation to fetch expanded url for shortened url
Click to show internal directories.
Click to hide internal directories.