kit

package module
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 22 Imported by: 90

Documentation

Index

Constants

View Source
const (
	// 结构
	MDB_DICT = "dict"
	MDB_META = "meta"
	MDB_HASH = "hash"
	MDB_LIST = "list"
	MDB_UNIQ = "uniq"

	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_LINK = "link"
	MDB_SCAN = "scan"
	MDB_SHOW = "show"
	MDB_HELP = "help"
	MDB_DATA = "data"
	MDB_PATH = "path"
	MDB_FILE = "file"
	MDB_LINE = "line"
	MDB_SIZE = "size"
	MDB_COST = "cost"

	// 数据
	MDB_TEXT = "text"
	MDB_NAME = "name"
	MDB_TYPE = "type"
	MDB_ZONE = "zone"
	MDB_TIME = "time"
	MDB_KEY  = "key"
	MDB_ID   = "id"
)

Variables

This section is empty.

Functions

func CSV

func CSV(file string, limit int, cb func(index int, value map[string]string, head []string)) error

func Capital

func Capital(str string) string

func Close added in v0.5.0

func Close(p interface{})

func Contains

func Contains(str, sub interface{}) bool

func Create

func Create(p string) (*os.File, string, error)

func Data

func Data(arg ...interface{}) map[string]interface{}

func Dict

func Dict(arg ...interface{}) map[string]interface{}

func Duration

func Duration(str interface{}) time.Duration

func Env added in v0.5.0

func Env(key string) string

func Ext

func Ext(str string) string

func ExtIsImage

func ExtIsImage(str string) bool

func Fetch

func Fetch(val interface{}, cbs interface{}) interface{}

func Fields added in v0.3.7

func Fields(arg ...interface{}) string

func FileExists

func FileExists(name string) bool

func FileLine

func FileLine(p interface{}, n int) string

func FileName

func FileName(p interface{}) string

func Filter added in v0.6.1

func Filter(arg []string, cb ...func(string) bool) (res []string)

func FmtSize

func FmtSize(size int64) string

func FmtTime

func FmtTime(t int64) string

func ForEach

func ForEach(arg []string, cb func(string))

func Format

func Format(val interface{}, arg ...interface{}) string

func FormatKV

func FormatKV(data map[string]interface{}, args ...string) string

func Formats

func Formats(val interface{}) string

func FuncName

func FuncName(p interface{}) string

func GetMeta

func GetMeta(value map[string]interface{}) map[string]interface{}

func Hash

func Hash(arg ...interface{}) (string, []string)

func Hashs

func Hashs(arg ...interface{}) string

func HashsPath added in v0.5.1

func HashsPath(arg ...interface{}) string

func HomePath added in v0.5.4

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

func IndexOf

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

func Int

func Int(val interface{}) int

func Int64

func Int64(val interface{}) int64

func IsDir added in v0.6.0

func IsDir(p string) bool

func Join

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

func KeyExtra added in v0.4.0

func KeyExtra(arg ...interface{}) string

func KeyHash

func KeyHash(arg ...interface{}) string

func KeyValue

func KeyValue(res map[string]interface{}, key string, arg interface{}) map[string]interface{}

func Keycb

func Keycb(arg ...interface{}) string

func Keym

func Keym(arg ...interface{}) string

func Keys

func Keys(arg ...interface{}) string

func List

func List(arg ...interface{}) []interface{}

func LowerCapital added in v0.6.1

func LowerCapital(str string) string

func Max added in v0.4.3

func Max(list ...int) (max int)

func MergePOD

func MergePOD(url string, pod string, arg ...interface{}) string

func MergeURL

func MergeURL(str string, arg ...interface{}) string

func MergeURL2

func MergeURL2(str string, uri string, arg ...interface{}) string

func ModName

func ModName(p interface{}) string

func ModPath added in v0.3.8

func ModPath(p interface{}, arg ...string) string

func Now added in v0.4.9

func Now(arg ...string) string

func Parse

func Parse(value interface{}, key string, val ...string) interface{}

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 PathName

func PathName(p interface{}) string

func Pwd

func Pwd() string

func ReadFile added in v0.5.0

func ReadFile(p string) string

func Reflect added in v0.5.7

func Reflect(obj interface{}, cb func(name string, value interface{})) (reflect.Type, reflect.Value)

func Regexp

func Regexp(arg string) *regexp.Regexp

func Render

func Render(str string, arg interface{}) (b []byte, e error)

func Replace

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

func ReplaceAll added in v0.4.4

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

func Revert

func Revert(str []string) []string

func Rewrite

func Rewrite(file string, cb func(string) string) error

func Select

func Select(def string, arg ...interface{}) string

func ShortKey

func ShortKey(list map[string]interface{}, min int, arg ...interface{}) string

func Simple

func Simple(val ...interface{}) []string

func SimpleKV added in v0.4.3

func SimpleKV(key string, arg ...interface{}) (res []string)

func Slice

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

func Sort

func Sort(list []string, cb ...func(a, b string) bool) []string

func SortedKey added in v0.5.8

func SortedKey(obj interface{}) (res []string)

func Split

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

func Time

func Time(arg ...string) int64

func TransArg

func TransArg(arg []string, key string, trans interface{}) []string

func TrimExt

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

func UnMarshal

func UnMarshal(data string) interface{}

func UserName added in v0.5.7

func UserName() string

func Value

func Value(root interface{}, args ...interface{}) interface{}

func Width

func Width(str string, mul int) int

func WriteFile added in v0.5.1

func WriteFile(p string, value interface{}) string

Types

This section is empty.

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

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