kit

package module
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 22 Imported by: 90

Documentation

Index

Constants

View Source
const (
	MIME_FORM = "application/x-www-form-urlencoded"
	MIME_FILE = "application/octet-stream"
	MIME_JSON = "application/json"
	MIME_TEXT = "text/plain"
	MIME_HTML = "text/html"
	MIME_PNG  = "image/png"
)
View Source
const (
	// 结构
	MDB_DICT = "dict"
	MDB_META = "meta"
	MDB_HASH = "hash"
	MDB_LIST = "list"

	MDB_FOREACH = "*"
	MDB_RANDOMS = "%"

	// 显示
	MDB_CONTENT = "content"
	MDB_TIMEOUT = "timeout"
	MDB_BUTTON  = "button"
	MDB_SCRIPT  = "script"
	MDB_TITLE   = "title"
	MDB_TOPIC   = "topic"
	MDB_STYLE   = "style"

	// 程序
	MDB_PREFIX = "prefix"
	MDB_DOMAIN = "domain"
	MDB_ACTION = "action"
	MDB_ALIAS  = "alias"
	MDB_ARGS   = "args"
	MDB_COST   = "cost"
	MDB_CODE   = "code"
	MDB_BACK   = "back"

	// 存储
	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_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_TEXT = "text"
	MDB_NAME = "name"
	MDB_TYPE = "type"
	MDB_ZONE = "zone"
	MDB_TIME = "time"
	MDB_KEY  = "key"
	MDB_ID   = "id"
)
View Source
const (
	SSH_ROUTE = "route"
)

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 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 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 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 IndexOf

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

func Int

func Int(val interface{}) int

func Int64

func Int64(val interface{}) int64

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 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 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 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) []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 map[string]string) []string

func TrimExt

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

func UnMarshal

func UnMarshal(data string) interface{}

func Value

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

func Width

func Width(str string, mul int) int

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