Documentation ¶
Index ¶
- func AddLog(l1 _log.Logger)
- func CleanWikiaComment(str string) string
- func CleanWikiaTag(str, tag string, deleteContent bool) string
- func Error(str string, args ...interface{})
- func Fatal(str string, args ...interface{})
- func GenerateUUID() string
- func GetKey(params ...interface{}) string
- func GetLastPathFromURL(str string) string
- func GetLogger(i ...int) _log.Logger
- func GetWikiaExternalLink(str string) string
- func Info(str string, args ...interface{})
- func InitLog(lvl LogLevel, json, color bool)
- func Log(field map[string]interface{})
- func NormalizeNewLine(str string) string
- func NormalizeWikiaInternalLink(str string) string
- func ParseDuration(durationStr string, startFromTime ...bool) (time.Duration, error)
- func PtrToBool(b *bool) bool
- func QueryToKey(query interface{}) string
- func RandomStr(n int) string
- func Recoverer(next http.Handler) http.Handler
- func RemoveAllHTMLTag(str string) string
- func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, ...)
- func ResponseWithPNG(w http.ResponseWriter, code int, data []byte, err error)
- func StrToPtrBool(str string) *bool
- func StrToStrSlice(str string) []string
- func Validate(data interface{}) error
- func WikiaExternalLinkToStr(str string) string
- func WikiaInternalLinkToStr(str string) string
- type LogLevel
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanWikiaComment ¶
CleanWikiaComment to remove wikia comment.
func CleanWikiaTag ¶
CleanWikiaTag to remove wikia tag.
func GenerateUUID ¶ added in v0.18.0
func GenerateUUID() string
GenerateUUID to generate random uuid.
func GetLastPathFromURL ¶ added in v0.10.0
GetLastPathFromURL to get the last path from url.
func GetWikiaExternalLink ¶
GetWikiaExternalLink to get wikia external link.
func NormalizeNewLine ¶
NormalizeNewLine to normalize new line to <br>.
func NormalizeWikiaInternalLink ¶
NormalizeWikiaInternalLink to normalize wikia internal link. [[NIJISANJI (main branch)|NIJISANJI]] => [[NIJISANJI]]
func ParseDuration ¶ added in v0.10.0
ParseDuration to parse ISO 8601 duration.
func QueryToKey ¶ added in v0.6.0
func QueryToKey(query interface{}) string
QueryToKey to convert query to key string.
func RemoveAllHTMLTag ¶
RemoveAllHTMLTag to remove all html tag.
func ResponseWithJSON ¶
func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, meta ...interface{})
ResponseWithJSON to write response with JSON format.
func ResponseWithPNG ¶ added in v0.2.0
func ResponseWithPNG(w http.ResponseWriter, code int, data []byte, err error)
ResponseWithPNG to write response with PNG.
func StrToPtrBool ¶ added in v0.6.0
StrToPtrBool to convert string to bool pointer.
func StrToStrSlice ¶ added in v0.7.0
StrToStrSlice to convert string to slice of string.
func Validate ¶
func Validate(data interface{}) error
Validate to validate struct using validate tag. Use pointer.
func WikiaExternalLinkToStr ¶
WikiaExternalLinkToStr to convert wikia external link to string.
func WikiaInternalLinkToStr ¶
WikiaInternalLinkToStr to convert wikia internal link to string.