kit

package module
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 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 (
	META_SOURCE = "meta.source"
	META_FIELD  = "meta.field"
	META_PATH   = "meta.path"
)
View Source
const (
	// 结构
	MDB_DICT = "dict"
	MDB_META = "meta"
	MDB_HASH = "hash"
	MDB_LIST = "list"

	MDB_FOREACH = "*"
	MDB_RANDOMS = "%"

	// 显示
	MDB_TEMPLATE = "template"
	MDB_CONTENT  = "content"
	MDB_TIMEOUT  = "timeout"
	MDB_BUTTON   = "button"
	MDB_SCRIPT   = "script"
	MDB_TRANS    = "trans"
	MDB_TITLE    = "title"
	MDB_TOPIC    = "topic"
	MDB_STYLE    = "style"
	MDB_COLOR    = "color"
	MDB_IMAGE    = "image"
	MDB_VIDEO    = "video"

	// 程序
	MDB_PREFIX = "prefix"
	MDB_DOMAIN = "domain"
	MDB_STATUS = "status"
	MDB_STREAM = "stream"
	MDB_ACTION = "action"
	MDB_BEFORE = "before"
	MDB_EXPIRE = "expire"
	MDB_REGEXP = "regexp"
	MDB_ALIAS  = "alias"
	MDB_EVENT  = "event"
	MDB_ERROR  = "error"
	MDB_STACK  = "stack"
	MDB_CHAIN  = "chain"
	MDB_LEVEL  = "level"
	MDB_MAIN   = "main"
	MDB_ARGS   = "args"
	MDB_COST   = "cost"
	MDB_CODE   = "code"
	MDB_MAKE   = "make"
	MDB_FROM   = "from"
	MDB_SHIP   = "ship"
	MDB_BACK   = "back"
	MDB_STEP   = "step"
	MDB_MENU   = "menu"

	// 存储
	MDB_SHORT = "short"
	MDB_FIELD = "field"
	MDB_STORE = "store"
	MDB_FSIZE = "fsize"
	MDB_TOTAL = "total"
	MDB_COUNT = "count"
	MDB_LIMIT = "limit"
	MDB_LEAST = "least"
	MDB_TABLE = "table"
	MDB_INDEX = "index"
	MDB_VALUE = "value"
	MDB_EXTRA = "extra"

	// 文件
	MDB_PROTO = "proto"
	MDB_LINK  = "link"
	MDB_PATH  = "path"
	MDB_FILE  = "file"
	MDB_LINE  = "line"
	MDB_DATA  = "data"
	MDB_SIZE  = "size"

	// 数据
	MDB_HELP = "help"
	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"
	SSH_REPOS  = "repos"
	SSH_SOURCE = "source"
	SSH_BRANCH = "branch"
	SSH_MASTER = "master"
)

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

func MergePOD(str string, pod string) 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 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, from string, to 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 Slice

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

func Sort

func Sort(list []string) []string

func SourcePath

func SourcePath(arg ...string) string

func Split

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

func SubKey

func SubKey(name string) 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