util

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LANG_FILE_EXT = ".json"
)

Variables

This section is empty.

Functions

func CWebp

func CWebp(file, out string) error

func Contains

func Contains(s, sep string) bool

func CopyFile added in v1.0.3

func CopyFile(path, dst string) error

func FormatJsonLangFile added in v1.1.0

func FormatJsonLangFile(root, path string) (map[string]string, error)

func FormatParam

func FormatParam(path string) string

func GetLang added in v1.0.7

func GetLang(r *http.Request) string

func GetLangShort added in v1.0.7

func GetLangShort(r *http.Request) string

func Gzip

func Gzip(file, out string) error

func LoadJsonLangFile added in v1.1.0

func LoadJsonLangFile(path string) (map[string]string, error)

func LoadYamlLangFile added in v1.1.0

func LoadYamlLangFile(path string) ([]byte, error)

func MapOf

func MapOf(kvs ...interface{}) (map[string]interface{}, error)

func MatchInParam

func MatchInParam(s1, s2 string) bool

func MatchRoute

func MatchRoute(path, url string) bool

func MinifyCss

func MinifyCss(file, out string) error

func MinifySvg added in v1.1.2

func MinifySvg(file, out string) error

func Obfuscate

func Obfuscate(file, out string) error

func ParseTemplates

func ParseTemplates(dir string, funcs template.FuncMap) (*template.Template, error)

func ReplaceFieldIND

func ReplaceFieldIND(dst, replacement interface{}) error

ReplaceFieldIND replace field if not default value

func ShouldCWebp

func ShouldCWebp(ext string) bool

func ShouldGZip

func ShouldGZip(name string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL