kit

package module
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 22 Imported by: 90

Documentation

Index

Constants

View Source
const (
	MOD_DATE  = "2006-01-02"
	MOD_TIME  = "2006-01-02 15:04:05.000"
	MOD_TIMES = "2006-01-02 15:04:05.000000"

	// 结构
	MDB_DICT = "dict"
	MDB_META = "meta"
	MDB_HASH = "hash"
	MDB_LIST = "list"
	MDB_UNIQ = "uniq"
	MDB_RAND = "rand"

	MDB_FOREACH = "*"
	MDB_RANDOMS = "%"

	// 存储
	MDB_SHORT = "short"
	MDB_FIELD = "field"
	MDB_TOTAL = "total"
	MDB_COUNT = "count"
	MDB_LIMIT = "limit"
	MDB_LEAST = "least"
	MDB_STORE = "store"
	MDB_FSIZE = "fsize"

	// 索引
	MDB_INDEX  = "index"
	MDB_VALUE  = "value"
	MDB_EXTRA  = "extra"
	MDB_ALIAS  = "alias"
	MDB_EXPIRE = "expire"
	MDB_STATUS = "status"
	MDB_STREAM = "stream"

	// 文件
	MDB_PATH = "path"
	MDB_FILE = "file"
	MDB_LINE = "line"
	MDB_SIZE = "size"
	MDB_LINK = "link"
	MDB_SCAN = "scan"
	MDB_SHOW = "show"
	MDB_COST = "cost"
	MDB_HELP = "help"
	MDB_ICON = "icon"

	// 数据
	MDB_VIEW = "view"
	MDB_DATA = "data"
	MDB_TEXT = "text"
	MDB_NAME = "name"
	MDB_TYPE = "type"
	MDB_ZONE = "zone"
	MDB_TIME = "time"
	MDB_KEY  = "key"
	MDB_ID   = "id"
)
View Source
const (
	DF = ":"
	PS = "/"
	PT = "."
	FS = ","

	PNG  = "png"
	JPG  = "JPG"
	JPEG = "JPEG"
	HTTP = "http"
)

Variables

This section is empty.

Functions

func AddUniq added in v0.7.1

func AddUniq(list []string, arg ...string) []string

func ArgDef added in v0.7.14

func ArgDef(arg []string, args ...string) []string

func BeginEnd added in v0.7.1

func BeginEnd(begin, end func()) func()

func Capital

func Capital(str string) string

func Chdir added in v0.7.14

func Chdir(p string)

func Contains

func Contains(str string, arg ...string) bool

func Cut added in v0.7.8

func Cut(str string, size int) string

func DayBegin added in v0.7.1

func DayBegin(t string) time.Time

func Default added in v0.7.1

func Default(list []string, arg ...string) []string

func Dir added in v0.7.10

func Dir(arg ...string) string

func Duration

func Duration(val Any) time.Duration

func Env added in v0.5.0

func Env(key string, def ...string) string

func EnvList added in v0.7.6

func EnvList(arg ...string) []string

func EnvSimple added in v0.7.1

func EnvSimple(arg ...string) (res []string)

func Ext

func Ext(str string) string

func ExtChange added in v0.7.1

func ExtChange(file, ext string) string

func ExtIsImage

func ExtIsImage(str string) bool

func ExtIsVideo added in v0.7.1

func ExtIsVideo(str string) bool

func ExtReg added in v0.7.1

func ExtReg(ext ...string) string

func Fields added in v0.3.7

func Fields(arg ...Any) string

func FileLine

func FileLine(p Any, n int) string

func FileLines added in v0.7.6

func FileLines(p Any) string

func FileName

func FileName(p Any) string

func Filters added in v0.7.1

func Filters(list []string, arg ...string) (res []string)

func Float added in v0.7.14

func Float(val Any) float64

func FmtDuration added in v0.6.8

func FmtDuration(t time.Duration) string

func FmtSize

func FmtSize(v ...Any) string

func Format

func Format(val Any, arg ...Any) string

func FormatKV

func FormatKV(data Map, args ...string) string

func FormatShow added in v0.6.4

func FormatShow(arg ...Any) string

func Formats

func Formats(val Any) string

func FuncName

func FuncName(p Any) string

func GetValid added in v0.7.1

func GetValid(cb ...func() string) (res string)

func HasPrefix added in v0.7.0

func HasPrefix(str string, arg ...string) bool

func HasPrefixList added in v0.7.5

func HasPrefixList(args []string, arg ...string) bool

func HasSuffix added in v0.7.1

func HasSuffix(str string, arg ...string) bool

func Hash

func Hash(arg ...Any) (string, []string)

func Hashs

func Hashs(arg ...Any) string

func HashsPath added in v0.5.1

func HashsPath(arg ...Any) string

func HashsUniq added in v0.8.2

func HashsUniq(arg ...Any) string

func HomePath added in v0.5.4

func HomePath(str string, rest ...string) string

func If added in v0.7.1

func If(exp Any, cb ...Any)

func IfNoKey added in v0.7.1

func IfNoKey(list Map, p string, cb func(string))

func IndexOf

func IndexOf(str []string, sub string) int

func Int

func Int(val Any) int

func Int64

func Int64(val Any) int64

func IsAbs added in v0.7.6

func IsAbs(p string) bool

func IsDir added in v0.6.0

func IsDir(p string) bool

func IsIn added in v0.7.5

func IsIn(str string, arg ...string) bool

func IsUpper added in v0.7.5

func IsUpper(str string) bool

func IsUrl added in v0.7.6

func IsUrl(p string) bool

func Join

func Join(str []string, arg ...string) string

func JoinCSS added in v0.8.1

func JoinCSS(arg ...string) string

func JoinKV added in v0.7.0

func JoinKV(inner, outer string, arg ...string) string

func JoinProperty added in v0.8.1

func JoinProperty(arg ...string) string

func JoinQuery added in v0.8.1

func JoinQuery(arg ...string) string

func JoinWord added in v0.8.1

func JoinWord(arg ...string) string

func KeyExtra added in v0.4.0

func KeyExtra(arg ...Any) string

func KeyHash

func KeyHash(arg ...Any) string

func Keycb

func Keycb(arg ...Any) string

func Keym

func Keym(arg ...Any) string

func Keys

func Keys(arg ...Any) string

func Length added in v0.7.12

func Length(val Any) int

func LowerCapital added in v0.6.1

func LowerCapital(str string) string

func Max added in v0.4.3

func Max(arg ...int) (max int)

func MergeURL

func MergeURL(str string, arg ...Any) string

func MergeURL2

func MergeURL2(str string, uri string, arg ...Any) string

func Min added in v0.7.1

func Min(arg ...int) (min int)

func ModName

func ModName(p Any) string

func ParseQuery added in v0.7.1

func ParseQuery(str string) url.Values

func ParseURL

func ParseURL(str string) *url.URL

func ParseURLMap

func ParseURLMap(str string) map[string]string

func Path

func Path(str string, rest ...string) string

func PathJoin added in v0.7.6

func PathJoin(dir, file string, arg ...string) string

func PathName

func PathName(p Any) string

func Paths added in v0.7.6

func Paths(str string, rest ...string) string

func Pwd

func Pwd() string

func QueryUnescape added in v0.7.1

func QueryUnescape(value string) string

func Reflect added in v0.5.7

func Reflect(obj Any, cb func(name string, value Any)) (reflect.Type, reflect.Value)

func Render

func Render(str string, arg Any) (b []byte, e error)

func Renders added in v0.7.0

func Renders(str string, arg Any) string

func Replace

func Replace(str string, arg ...string) string

func ReplaceAll added in v0.4.4

func ReplaceAll(str string, arg ...string) string

func Reverse added in v0.7.5

func Reverse(str []string) []string

func Select

func Select(def string, arg ...Any) string

func Setenv added in v0.7.14

func Setenv(key string, val string)

func ShortKey

func ShortKey(list Map, min int, arg ...Any) string

func Simple

func Simple(arg ...Any) (res []string)

func SimpleKV added in v0.4.3

func SimpleKV(key string, arg ...Any) (res []string)

func Slice

func Slice(list []string, index ...int) []string

func SliceRemove added in v0.7.1

func SliceRemove(list []string, key string) ([]string, int)

func Sort

func Sort(list []string) []string

func SortedKey added in v0.5.8

func SortedKey(obj Any) (res []string)

func SortedValue added in v0.7.0

func SortedValue(obj Any) (res []string)

func Split

func Split(str string, arg ...string) (res []string)

func SplitKV added in v0.7.1

func SplitKV(inner, outer string, text string, cb func(text string, ls []string))

func SplitLine added in v0.7.1

func SplitLine(text string) []string

func SplitQuery added in v0.8.2

func SplitQuery(str string) []string

func SplitWord added in v0.7.1

func SplitWord(text string) []string

func Time

func Time(arg ...string) int64

func TimeUnix added in v0.8.0

func TimeUnix(stamp Any) string

func TransArg

func TransArg(arg []string, key string, trans Any) []string

func TransArgKey added in v0.7.12

func TransArgKey(arg []string, trans map[string]string) []string

func TrimArg added in v0.8.1

func TrimArg(arg ...string) []string

func TrimExt

func TrimExt(str string, ext ...string) string

func TrimPath added in v0.7.1

func TrimPath(p string) string

func TrimPrefix added in v0.7.10

func TrimPrefix(str string, arg ...string) string

func UserName added in v0.5.7

func UserName() string

func Width

func Width(str string, mul int) int

Types

type Any added in v0.6.4

type Any = interface{}

func Fetch

func Fetch(val Any, cb Any) Any

func For added in v0.7.2

func For(val Any, cb Any) Any

func Ignore added in v0.7.9

func Ignore(arg ...Any) Any

func Lasterr added in v0.7.12

func Lasterr(arg ...Any) Any

func List

func List(arg ...Any) []Any

func Parse

func Parse(value Any, key string, val ...string) Any

func Switch added in v0.7.1

func Switch(exp Any, arg ...Any) Any

func UnMarshal

func UnMarshal(buf Any) (res Any)

func Value

func Value(root Any, args ...Any) Any

type Map added in v0.6.4

type Map = map[string]Any

func Data

func Data(arg ...Any) Map

func Dict

func Dict(arg ...Any) Map

func DictList added in v0.7.1

func DictList(arg ...string) Map

func GetMeta

func GetMeta(value Map) Map

func KeyValue

func KeyValue(res Map, key string, arg Any) Map

func Merge added in v0.8.0

func Merge(to Map, from Map) Map

type Maps added in v0.6.5

type Maps = map[string]string

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

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