Documentation
¶
Index ¶
- Constants
- func BleveSafe(s string) string
- func CapFirstLetter(s string) string
- func CheckToBool(str string) bool
- func CropImageFromCenter(img image.Image) (image.Image, error)
- func DataDir() string
- func FormatAndAssign(width uint, height uint, im []*image.Paletted, pal color.Palette, ...) error
- func FormatFrames(width uint, height uint, frame *image.Paletted, pal color.Palette, ...) (*image.Paletted, error)
- func FormatGif(width uint, height uint, src string, full_path string, crop bool) error
- func FormatJpg(width uint, height uint, src string, full_path string, crop bool) error
- func FormatPng(width uint, height uint, src string, full_path string, crop bool) error
- func GenerateLink(baseurl, namespace string, size int) (string, string)
- func GenerateSecureKey() string
- func GetFileContentType(out *os.File) (string, error)
- func HTMLEscapeAll(this interface{})
- func HashToId(hash, salt string) (int64, error)
- func IdToHash(id int64, salt string) (string, error)
- func ImageContainer(rect image.Rectangle) draw.Image
- func ImageToPaletted(img image.Image, pal color.Palette) *image.Paletted
- func IsAllowedCommentTag(t html.Token) (bool, bool)
- func IsAllowedTag(t html.Token) bool
- func IsBreakTag(t html.Token) bool
- func ParseBreaksHtml(r io.Reader) *bytes.Buffer
- func ParseCommentHtml(r io.Reader) *bytes.Buffer
- func ParseHtml(r io.Reader) *bytes.Buffer
- func PrettifyString(s string) string
- func PrettyTime(t time.Time) string
- func RandomString(n int) string
- func ResizeImage(img image.Image, maxWidth uint, maxHeight uint) image.Image
- func Safe(s string) string
- func SafeNoHref(s string) string
- func SafeTsAndCs(s string) string
- func SimpleDate(st string) string
- func Strip(s string) string
- func StripHtmlTags(r io.Reader) *bytes.Buffer
- func ValidateImage(b []byte) (string, error)
- func ValidateMimeType(b []byte) string
- func ValidateMimeTypeString(s string) string
- func ValidateVideoMimeType(b []byte) string
- func WidthHeight(img image.Image, maxWidth uint, maxHeight uint) (uint, uint)
- type Email
- type Event
- type Mailer
- type Pagi
- type SensorEvent
- type TokenEvent
Constants ¶
View Source
const ( StateProduction = "production" StateTest = "test" StateDevelopment = "development" ProdDataDir = "data" TestDataDir = "data_test" DevDataDir = "data_dev" )
View Source
const HashMin = 16
View Source
const Maxlen = 32
Variables ¶
This section is empty.
Functions ¶
func CapFirstLetter ¶
func CheckToBool ¶
func FormatAndAssign ¶
func FormatFrames ¶
func GenerateSecureKey ¶
func GenerateSecureKey() string
Copy of auth.GenerateSecureKey to prevent cyclic import with auth library
func HTMLEscapeAll ¶
func HTMLEscapeAll(this interface{})
func IsAllowedTag ¶
func IsBreakTag ¶
func ParseCommentHtml ¶
Parses the supplied HTML found in the io.reader It iterates over the the tags using the IsAllowedTag() method in order to find tags that are allowed.
func ParseHtml ¶
Parses the supplied HTML found in the io.reader It iterates over the the tags using the IsAllowedTag() method in order to find tags that are allowed.
func PrettifyString ¶
func PrettyTime ¶
func RandomString ¶
RandomString isn't crypto secure or anything we just need a psuedo random key to be generated for our canary token
func SafeNoHref ¶
func SafeTsAndCs ¶
allow a tiny subset of html elements with only the href attr on <a>
func SimpleDate ¶
func ValidateImage ¶
func ValidateMimeType ¶
func ValidateMimeTypeString ¶
Types ¶
type Mailer ¶
type Pagi ¶
type Pagi struct { Offset int OffsetSize int Limit int Page int PageTotal int GrandTotal int PrevPage int PrevEnabled bool PrevLink string NextPage int NextEnabled bool NextLink string BaseURI string }
func (*Pagi) CalcOffset ¶
func (this *Pagi) CalcOffset()
func (*Pagi) ConfigureMan ¶
func (*Pagi) LimitIsValid ¶
func (*Pagi) PageIsValid ¶
func (*Pagi) SetupButtons ¶
func (this *Pagi) SetupButtons()
type SensorEvent ¶
type SensorEvent struct {
ID int64
}
type TokenEvent ¶
type TokenEvent struct { }