Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PasteKeepForever indicates that paste should be kept forever. PasteKeepForever = 0 // PasteKeepForMinutes indicates that saved timeout is in minutes. PasteKeepForMinutes = 1 // PasteKeepForHours indicates that saved timeout is in hours. PasteKeepForHours = 2 // PasteKeepForDays indicates that saved timeout is in days. PasteKeepForDays = 3 // PasteKeepForMonths indicates that saved timeout is in months. PasteKeepForMonths = 4 )
Variables ¶
View Source
var PasteKeepsCorrelation = map[string]int{ "M": PasteKeepForMinutes, "h": PasteKeepForHours, "d": PasteKeepForDays, "m": PasteKeepForMonths, "forever": PasteKeepForever, }
PasteKeepsCorrelation is a correlation map between database representation and passed data representation.
Functions ¶
This section is empty.
Types ¶
type Paste ¶
type Paste struct { CreatedAt *time.Time `db:"created_at" json:"created_at"` Title string `db:"title" json:"title"` Data string `db:"data" json:"data"` Language string `db:"language" json:"language"` Password string `db:"password" json:"password"` PasswordSalt string `db:"password_salt" json:"password_salt"` ID int `db:"id" json:"id"` KeepFor int `db:"keep_for" json:"keep_for"` KeepForUnitType int `db:"keep_for_unit_type" json:"keep_for_unit_type"` Private bool `db:"private" json:"private"` }
Paste represents paste itself.
func (*Paste) CreatePassword ¶
CreatePassword creates password for current paste.
func (*Paste) GenerateCryptedCookieValue ¶
GenerateCryptedCookieValue generates crypted cookie value for paste.
func (*Paste) IsExpired ¶
IsExpired checks if paste is already expired (or not).
Click to show internal directories.
Click to hide internal directories.