Documentation ¶
Overview ¶
mcore package wrap String ArrayList and etc.
Index ¶
- Constants
- Variables
- func Append(old []interface{}, value interface{}) []interface{}
- func AppendBefore(old []interface{}, value interface{}) (r []interface{})
- func AppendFile(file string, appendContent string) (int, error)
- func AppendFileBefore(file string, appendContent string) (int, error)
- func AppendFileByLocation(file string, appendContent string, before bool) (int, error)
- func CheckNullOrBlank(value interface{}, format string, args ...interface{}) bool
- func CheckNullOrBlankWithErrMsg(value interface{}, errMsg string) bool
- func DirSubFiles(dir string) ([]string, error)
- func DirSubs(dir string) ([]string, error)
- func EncodeGBK(in string) string
- func Expand(v string) string
- func ExpandPath(path string) string
- func FormatFloat(v float64) string
- func FormatTime(t time.Time) string
- func GetArgBool(name string, defaultValue bool, args ...string) bool
- func GetArgInt(name string, defaultValue int, args ...string) int
- func GetArgString(name string, defaultValue string, args ...string) string
- func GetArrayFields(m interface{}) []string
- func GetArrayFirstElement(rows interface{}) interface{}
- func GetConfigValue(lines []string, key string, sep string) (string, error)
- func GetCurrentDay() int
- func GetCurrentMonth() int
- func GetCurrentYear() int
- func GetDirSubFiles(dir string) (fs []string)
- func GetElementType(v interface{}) reflect.Type
- func GetElementTypeName(v interface{}) string
- func GetEnv(name string) string
- func GetFieldType(v interface{}, field string) reflect.Kind
- func GetFieldValue(v interface{}, field string) (r string)
- func GetFieldValueOrigin(v interface{}, field string) interface{}
- func GetFields(m interface{}) (ns []string)
- func GetFieldsUsed(fs []string, include, exclude string) (r []string)
- func GetFieldsUsed2(fs []string, include, exclude string) (r []string)
- func GetFileConfigValue(location string, key string, sep string) (string, error)
- func GetFileContent(file string) (string, error)
- func GetFileDir(location string) string
- func GetFileModifyTime(file string) (int64, error)
- func GetFileName(path string) string
- func GetFileSize(file string) (int64, error)
- func GetFixedWidthNum(num int, width int) string
- func GetFixedWidthString(v string, width int, fil string, alignLeft bool) string
- func GetFixedWidthStringAlignLeft(v string, width int) string
- func GetFixedWidthStringAlignRight(v string, width int) string
- func GetFlagString(name string) string
- func GetLocation(dir string, file string) string
- func GetMapKeys(m map[string]interface{}) (r []string)
- func GetMappedName(name string, mapRules string) string
- func GetMethods(v interface{}) (r []string)
- func GetOS() string
- func GetPackageNameFromDir(dir string) string
- func GetParseArgs(args ...string) []string
- func GetPkgPath(v interface{}) string
- func GetRealPath(file string) string
- func GetReflectFieldValue(v interface{}, fn string) reflect.Value
- func GetReflectValue(v interface{}) reflect.Value
- func GetString(value interface{}) string
- func GetSubFiles(dir string, r bool, exts string, skipDirs string, skipFiles string) []string
- func GetSubFilesImpl(result *[]string, dir string, r bool, exts string, skipDirs string, ...) error
- func GetType(v interface{}) reflect.Type
- func GetTypeName(v interface{}) string
- func GetUsedArrayFields(m interface{}, include, exclude string) []string
- func GetUsedFields(v interface{}, include, exclude string) (r []string)
- func Home() string
- func IsArgExists(name string, args ...string) bool
- func IsChineseChar(str string) bool
- func IsDarwin() bool
- func IsEnvExist(name string) bool
- func IsError(v interface{}) (r bool)
- func IsException(e Exception) bool
- func IsExceptionType(err error) bool
- func IsFile(file string) bool
- func IsFileExist(path string) bool
- func IsGitRepo() bool
- func IsHasArg(arg string) bool
- func IsHasDevArg() bool
- func IsHasMethod(v interface{}, methodName string) bool
- func IsHasProdArg() bool
- func IsHasTestArg() bool
- func IsIncludeExcludeIn(field string, fields []string, include, exclude string) bool
- func IsLinux() bool
- func IsMapHasKey(m map[string]interface{}, key string) bool
- func IsReturnHasError(args ...interface{}) (r bool)
- func IsRuntimeException(e Exception) bool
- func IsRuntimeExceptionType(err error) bool
- func IsUpLetter(l string) bool
- func IsValueEqual(a, b interface{}) bool
- func IsWindows() bool
- func Join(sep string, args ...interface{}) string
- func JoinArgs(renderArgs map[string]interface{}, args ...string) []string
- func JoinArray(sep string, args []interface{}) string
- func JoinPath(paths ...string) string
- func MakeDir(dir string) error
- func MoveFile(oldPath, newPath string) error
- func NewCommand(args []string) *exec.Cmd
- func NewCommandFromString(cmd string) *exec.Cmd
- func NewFileWriter(location string) (io.Writer, error)
- func NewRandom() int
- func NewRandomPassword() string
- func NewRangeRandom(n int) int
- func Now() time.Time
- func ParseStringToArgs(s string) []string
- func PrepareFile(location string) error
- func PrepareFileDir(file string) error
- func Print(v ...interface{})
- func PrintFile(location string)
- func PrintFile2(location string)
- func PrintFileWithLineNumber(file string)
- func PrintModel(model interface{})
- func PrintModels(models []interface{})
- func PrintStringArray(vs []string)
- func PrintSubFiles(dir string, r bool, exts string)
- func PrintTime(t time.Time)
- func PrintType(v interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func ProcessDir(dir string) string
- func PutEnv(name, value string) error
- func ReadArgs() []string
- func ReadBool(dft bool, msg ...interface{}) bool
- func ReadFileAll(file string) (string, error)
- func ReadFileLines(file string) (lines []string, err error)
- func ReadInt(msg ...interface{}) int
- func ReadLine() string
- func ReadLineWithMsg(msgs ...interface{}) string
- func ReadNotBlankLine() (result string)
- func ReadNotBlankLineWithMsg(msgs ...interface{}) string
- func ReadNotZeroInt(msg ...interface{}) int
- func ReadSelectArray(vs []string, msg ...interface{}) string
- func ReadUrl(url string) ([]byte, error)
- func ReadUrlText(url string) (string, error)
- func RemoveFile(file string) error
- func RenameFile(file string, to string) error
- func SetFieldValue(v interface{}, field string, newValue interface{}) interface{}
- func StrToFloat64(v string) (r float64, err error)
- func StrToInt(v string) (r int, err error)
- func StrToInt64(v string) (r int64, err error)
- func StringLen(v string) int
- func StringWidth(v string) int
- func Sub(str string, start, length int) string
- func SubByByte(str string, length int) string
- func SubLeft(s string, end int) string
- func SubRight(s string, start int) string
- func ToCamel(name string) string
- func ToLabel(name string) string
- func ToTableName(name string) string
- func TouchFile(file string) error
- func UpperCaseFirst(in string) string
- func WriteFile(file string, content string) (n int, err error)
- func WriteFileBytes(file string, v []byte) error
- func WriteFileGBK(file, text string) (int, error)
- func WriteFileLines(file string, lines []string) (int, error)
- func WriteFileReader(file string, r io.Reader) error
- func WriteFileWithError(location, content string, err error) error
- type Any
- type Args
- type ArrayList
- func (s *ArrayList) IsContain(value interface{}) bool
- func (s *ArrayList) Len() int
- func (s *ArrayList) Next() bool
- func (s *ArrayList) Print()
- func (s *ArrayList) Put(values ...interface{})
- func (s *ArrayList) Remove(value interface{})
- func (s *ArrayList) Type() reflect.Type
- func (s *ArrayList) Value() interface{}
- type Bool
- type Byte
- type Bytes
- type Date
- type DateTime
- type Day
- type Email
- type Error
- type ErrorType
- type Errors
- type Exception
- type FileNotFoundError
- type Float32
- type Float64
- type Generater
- type Hour
- type Int
- type Int32
- type Int64
- type KeyValue
- type KeyValueArray
- func (kva *KeyValueArray) Bool() bool
- func (kva *KeyValueArray) Float64(dv float64) float64
- func (kva *KeyValueArray) Int(dv int) int
- func (kva *KeyValueArray) IsContainKey(key string) bool
- func (kva *KeyValueArray) Key() string
- func (kva *KeyValueArray) KeyBool(key string) bool
- func (kva *KeyValueArray) KeyFloat64(key string, dv float64) (float64, bool)
- func (kva *KeyValueArray) KeyInt(key string, dv int) (int, bool)
- func (kva *KeyValueArray) KeyString(key string) (string, bool)
- func (kva *KeyValueArray) Keys() []string
- func (kva *KeyValueArray) MoveTop()
- func (kva *KeyValueArray) Next() bool
- func (kva *KeyValueArray) Put(key string, value interface{})
- func (kva *KeyValueArray) String() string
- func (kva *KeyValueArray) Value() interface{}
- type KeyValueMap
- type List
- type Location
- type Minute
- type Money
- func (m Money) DivdeBai() Money
- func (m Money) Divide(beDivided float64) Money
- func (m Money) DivideWan() Money
- func (m Money) DivideYi() Money
- func (m Money) Minus(to Money) Money
- func (m Money) Multiple(beNum float64) Money
- func (m Money) MultipleBai() Money
- func (m Money) MultipleWan() Money
- func (m Money) MultipleYi() Money
- func (m Money) Plus(to Money) Money
- type Month
- type NumberFormatError
- type OutRecorder
- type Quarter
- type Results
- func (r *Results) IsHasError() bool
- func (r *Results) IsHasMsg() bool
- func (r *Results) Print()
- func (r *Results) PrintErrors()
- func (r *Results) PrintMsgs()
- func (r *Results) RecordError(err error)
- func (r *Results) RecordErrorMsg(errMsg ...interface{})
- func (r *Results) RecordMsg(msg ...interface{})
- func (r *Results) RecordfError(format string, args ...interface{})
- func (r *Results) RecordfMsg(format string, args ...interface{})
- type Rune
- type RuntimeException
- type Second
- type String
- func (s String) AddEnd(end string) String
- func (s String) AddPrefix(pre string) String
- func (s String) AddStart(start string) String
- func (s String) AddSuffix(suf string) String
- func (s String) Count(sep string) int
- func (s String) Fields() []string
- func (s String) Index(sep string) int
- func (s String) IndexAny(chars string) int
- func (s String) IndexByte(c byte) int
- func (s String) IndexRune(r rune) int
- func (s String) Int() int
- func (s String) IsBlank() (r bool)
- func (in String) IsChinese() bool
- func (s String) IsContainIgnoreCase(sub string) bool
- func (s String) IsContainInArray(args []string) bool
- func (s String) IsContainInArrayIgnoreCase(args []string) bool
- func (s String) IsContains(sub string) bool
- func (s String) IsContainsAny(chars string) bool
- func (s String) IsContainsInSepString(arg string, sep string) bool
- func (s String) IsContainsInSepStringIgnoreCase(arg string, sep string) bool
- func (s String) IsContainsRune(r rune) bool
- func (in String) IsEmail() bool
- func (s String) IsEndWith(end string) bool
- func (in String) IsEnglish() bool
- func (s String) IsEqualFold(t string) bool
- func (s String) IsEqualIgnoreCase(v string) bool
- func (s String) IsHasAny(chars string) (r bool)
- func (s String) IsHasPrefix(prefix string) bool
- func (s String) IsHasSuffix(suffix string) bool
- func (in String) IsIdCardNo() bool
- func (s String) IsIn(args ...string) bool
- func (s String) IsInArray(args []string) bool
- func (s String) IsInArrayIgnoreCase(args []string) bool
- func (s String) IsInIgnoreCase(args ...string) bool
- func (s String) IsInSepString(arg string, sep string) bool
- func (s String) IsInSepStringIgnoreCase(arg string, sep string) bool
- func (in String) IsMatchString(exp string) bool
- func (in String) IsMustCompileMatch(pattern string) bool
- func (s String) IsNotBlank() bool
- func (s String) IsNotIn(args ...string) bool
- func (s String) IsNotInArray(args []string) bool
- func (s String) IsNotInArrayIgnoreCase(args []string) bool
- func (s String) IsNotInIgnoreCase(args ...string) bool
- func (s String) IsNotInSepString(arg string, sep string) bool
- func (s String) IsNotInSepStringIgnoreCase(arg, sep string) bool
- func (in String) IsNumber() bool
- func (in String) IsPhoneNumber() bool
- func (s String) IsStartIgnoreCase(prefix string) bool
- func (s String) IsStartInIgnoreCase(args []string) bool
- func (s String) IsStartWith(start string) bool
- func (s String) IsStartsIgnoreCase(prefixs ...string) bool
- func (s String) IsStartsIgnoreCaseInArray(prefixs []string) bool
- func (s String) LastIndex(sep string) int
- func (s String) LastIndexAny(chars string) int
- func (s String) Len() int
- func (s String) Quote() string
- func (s String) QuoteToASCII() string
- func (s String) Repeat(count int) String
- func (s String) Replace(old, newStr string, n int) String
- func (s String) ReplaceAll(old, newStr string) String
- func (s String) ReplaceAllNumber(newStr string) String
- func (s String) SepEnd(sep string) (r String)
- func (s String) SepStart(sep string) (r String)
- func (s String) Split(sep string) []string
- func (s String) String() string
- func (s String) Sub(start, length int) String
- func (s String) SubLeft(length int) String
- func (s String) SubLeftSep(sep string) string
- func (s String) SubRight(length int) String
- func (s String) SubRightSep(sep string) string
- func (s String) Title() String
- func (s String) ToBool() bool
- func (s String) ToBytes() []byte
- func (s String) ToExcelTime() time.Time
- func (s String) ToExcelTimeString() string
- func (s String) ToFloat(bitSize int) (float64, error)
- func (s String) ToFloat32() (float32, error)
- func (s String) ToFloat32NoError() float32
- func (s String) ToFloat64() (float64, error)
- func (s String) ToFloat64NoError() float64
- func (s String) ToInt() (int, error)
- func (s String) ToIntNoError() int
- func (s String) ToLower() String
- func (s String) ToTime() (time.Time, error)
- func (s String) ToUpper() String
- func (s String) Trim(cutset string) String
- func (s String) TrimBeginIndex(sep string) String
- func (s String) TrimEnd(end string) String
- func (s String) TrimEndIndex(sep string) String
- func (s String) TrimEnds(ends ...string) String
- func (s String) TrimLeft(cutset string) String
- func (s String) TrimPrefix(prefix string) String
- func (s String) TrimQuotes() String
- func (s String) TrimRight(cutset string) String
- func (s String) TrimSpace() String
- func (s String) TrimStart(start string) String
- func (s String) TrimStarts(starts ...string) String
- func (s String) TrimSuffix(suffix string) String
- func (s String) Unquote() (string, error)
- func (s String) Value() string
- type StringArray
- func (s StringArray) AppendStringArray(a StringArray) StringArray
- func (s StringArray) Join(sep string) string
- func (s StringArray) Merge() string
- func (s StringArray) MergeWithOsNewLine() string
- func (s StringArray) RemoveBlank() (r StringArray)
- func (s StringArray) RemoveBlankAndComment(start string) StringArray
- func (s StringArray) RemoveBlankAndSharpComment() StringArray
- func (s StringArray) RemoveBlankAndSlashComment() StringArray
- func (s StringArray) RemoveComment(start string) (r StringArray)
- func (s StringArray) RemoveSharpComment() StringArray
- func (s StringArray) RemoveSlashComment() StringArray
- func (s StringArray) RoundJoin(round, sep string) string
- type StringBuffer
- func (sb StringBuffer) Append(args ...interface{})
- func (sb StringBuffer) AppendArrayCSVLine(values []string)
- func (sb StringBuffer) AppendByteArray(bs []byte)
- func (sb StringBuffer) AppendEachLine(lines ...interface{})
- func (sb StringBuffer) AppendLine(args ...interface{})
- func (sb StringBuffer) AppendLinef(format string, args ...interface{})
- func (sb StringBuffer) AppendLines(lines []string)
- func (sb StringBuffer) Appendf(format string, args ...interface{})
- func (sb StringBuffer) Clear()
- func (sb StringBuffer) HTML() template.HTML
- func (sb StringBuffer) Print()
- func (sb StringBuffer) String() string
- func (sb StringBuffer) WriteTo(dest io.Writer) (int64, error)
- func (sb StringBuffer) WriteToFile(file string) (int64, error)
- type StringKeyValueMap
- func (c StringKeyValueMap) GetBool(key string) bool
- func (c StringKeyValueMap) GetInt(key string) int
- func (c StringKeyValueMap) GetString(key string) string
- func (c StringKeyValueMap) GetStringWithDefault(key, defaultValue string) string
- func (c StringKeyValueMap) IsContain(key string) bool
- func (c StringKeyValueMap) Put(key, value string)
- type Time
- type Validetor
- type Week
- type WeekDay
- type WrapArgs
- type Year
- type YearDay
Examples ¶
Constants ¶
const ( TRUE = true FALSE = false )
const ( B_TRUE = Bool(TRUE) B_FALSE = Bool(FALSE) )
const ( BAI = 100 QIAN = 1000 WAN = 10000 BAI_WAN = 100 * 10000 QIAN_WAN = 1000 * 10000 YI = 10000 * 10000 WAN_YI = 10000 * 10000 * 10000 )
const DefaultTimeFormat = "2006-01-02 15:04:05"
const ( // NewLine . NewLine = byte(10) )
const (
UP_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
)
Variables ¶
var ErrInvalidNumber = errors.New("Invalid number format")
var (
MonthArray []string = []string{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
)
var O_NL = "\n"
var (
WeekDayArray []string = []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
)
Functions ¶
func AppendBefore ¶
func AppendBefore(old []interface{}, value interface{}) (r []interface{})
AppendBefore append array
func AppendFile ¶
AppendFile append file
func AppendFileBefore ¶
AppendFileBefore append file from beginning
func AppendFileByLocation ¶
AppendFileByLocation append file by location
func CheckNullOrBlank ¶
check value if null or blank
func DirSubFiles ¶
DirSubFiles returns dir sub files.
func ExpandPath ¶
ExpandPath expand ~,%VAR%,$VAR,$(VAR),${VAR) to real path
func GetArgBool ¶
GetArgBool return bool value
func GetArgString ¶
GetArgString arg format: a=b
func GetArrayFields ¶
func GetArrayFields(m interface{}) []string
GetArrayFields m must be a array type.
func GetArrayFirstElement ¶
func GetArrayFirstElement(rows interface{}) interface{}
GetArrayFirstElement return rows first row. rows must be a slice.
func GetConfigValue ¶
GetConfigValue returns config value from lines.
func GetCurrentDay ¶
func GetCurrentDay() int
func GetCurrentMonth ¶
func GetCurrentMonth() int
func GetCurrentYear ¶
func GetCurrentYear() int
func GetDirSubFiles ¶
GetPathFiles returns all file in dir
func GetElementType ¶
GetElementType v should be a slicce.
func GetElementTypeName ¶
func GetElementTypeName(v interface{}) string
GetElementTypeName values Type support struct, pointer, slice slice returns first element type.
func GetFieldType ¶
GetFieldType return refelect.Kind, so can switch it.
func GetFieldValue ¶
GetFieldValue v can be struct or pointer.
func GetFieldValueOrigin ¶
func GetFieldValueOrigin(v interface{}, field string) interface{}
GetFieldValueOrigin returns interface{}
func GetFields ¶
func GetFields(m interface{}) (ns []string)
GetFields returns Fields Name Array, m could be pointer or struct. Emmber Struct call in rotate
func GetFieldsUsed ¶
GetFieldsUsed Order by Include if has include
func GetFieldsUsed2 ¶
GetFieldsUsed2 Order by fs
func GetFileConfigValue ¶
GetFileConfigValue returns config value from config files
func GetFileContent ¶
GetFileContent returns string from text file
func GetFileModifyTime ¶
GetFileModifyTime returns file modified time
func GetFileName ¶
GetFileName returns path filename. path seperate with "/"
func GetFixedWidthNum ¶
GetFixedWidthNum used for line number add space left side, align right
func GetFixedWidthString ¶
GetFixedWidthString
func GetFixedWidthStringAlignLeft ¶
GetFixedWidthStringAlignLeft add blank to left used for pretty output.
func GetFixedWidthStringAlignRight ¶
GetFixedWidthStringAlignRight add blank right
func GetMapKeys ¶
func GetMappedName ¶
GetMappedName return mapped name with mapRules
func GetPackageNameFromDir ¶
dir such as abc/def or abc\\def for windows, return def
func GetParseArgs ¶
func GetReflectFieldValue ¶
GetReflectFieldValue returns reflect.Value.
func GetReflectValue ¶
GetReflectValue, returns reflect.Value, support both struct and pointer. if value is a pointer, indirect into it.
func GetSubFiles ¶
GetSubFiles returns dir sub files exts: format .xx format. r: recursive
func GetSubFilesImpl ¶
func GetSubFilesImpl( result *[]string, dir string, r bool, exts string, skipDirs string, skipFiles string, ) error
GetSubFilesImp returns sub files
func GetUsedArrayFields ¶
GetUsedArrayFields
func GetUsedFields ¶
GetUsedFields
func IsChineseChar ¶
func IsExceptionType ¶
func IsFileExist ¶
IsFileExist returns whether a file or directory exists.
func IsGitRepo ¶
func IsGitRepo() bool
IsGitRepo reports whether the working directory is inside a Git repository.
func IsHasDevArg ¶
func IsHasDevArg() bool
func IsHasMethod ¶
IsHasMethod use GetMethods to judge.
func IsHasProdArg ¶
func IsHasProdArg() bool
func IsHasTestArg ¶
func IsHasTestArg() bool
func IsIncludeExcludeIn ¶
IsIncludeExcludeIn
func IsMapHasKey ¶
func IsReturnHasError ¶
func IsReturnHasError(args ...interface{}) (r bool)
IsReturnHasError check returns
func IsRuntimeException ¶
IsRuntimeException is runtime Exception
func IsRuntimeExceptionType ¶
IsRuntimeExceptionType is runtime Exception type
func NewCommand ¶
NewCommand return new exec cmd args[0] cmd name args[1:] cmd args
func NewCommandFromString ¶
NewCommandFromString create
func NewFileWriter ¶
NewFileWriter file may not exist. if file not exist, create one.
func NewRandom ¶
func NewRandom() int
NewRandom generate new random integer number.
Example ¶
for i := 0; i < 100; i++ { println(i, ":", NewRandom()) } println("======================================") for i := 0; i < 100; i++ { println(i, ":", NewRangeRandom(1000000)) }
Output:
func NewRandomPassword ¶
func NewRandomPassword() string
NewRandomPassword generate new number password.
func NewRangeRandom ¶
NewRangeRandom generate new random integer number range in 0~n
func ParseStringToArgs ¶
ParseStringToArgs line to args FIXME not work as expect
func PrintModel ¶
func PrintModel(model interface{})
inpect model and print model should be a struct
func PrintModels ¶
func PrintModels(models []interface{})
func PrintSubFiles ¶
PrintSubFiles exts format: .xxx,yyy
func ReadNotBlankLineWithMsg ¶
func ReadNotBlankLineWithMsg(msgs ...interface{}) string
ReadNotBlankLineWithMsg .
func ReadSelectArray ¶
ReadSelectArray returns select array elements. vs should has elements
func ReadUrlText ¶
func SetFieldValue ¶
func SetFieldValue(v interface{}, field string, newValue interface{}) interface{}
SetFieldValue change struct field value. should use struct pointer.
func StrToInt64 ¶
func ToTableName ¶
ToTableName example: DemoTable to demo_table
func WriteFileBytes ¶
WriteFileBytes write file bytes
func WriteFileLines ¶
WriteFileLines write file lines
func WriteFileReader ¶
WriteFileReader write file header
func WriteFileWithError ¶
WriteFileWithError get content from somewhere may be occur error when error is not nil, skip write
Types ¶
type ArrayList ¶
type ArrayList struct {
// contains filtered or unexported fields
}
ArrayList implements List interface.
func NewArrayList ¶
func NewArrayList(model interface{}) *ArrayList
NewArrayList create a ArrayList instance. model
type Bytes ¶
type Bytes []byte
func (Bytes) AppendBool ¶
func (Bytes) AppendQuote ¶
func (Bytes) AppendQuoteRune ¶
type Date ¶
func GetCurrentDate ¶
func GetCurrentDate() Date
type DateTime ¶
func GetCurrentDateTime ¶
func GetCurrentDateTime() (dt DateTime)
func ParseDefault ¶
func WrapDateTime ¶
type Exception ¶
type Exception struct { ErrorType // contains filtered or unexported fields }
Exception app can not go on. app should check it.
func NewExceptionf ¶
NewExceptionf create
type FileNotFoundError ¶
type FileNotFoundError struct {
RuntimeException
}
FileNotFoundError define
func NewFileNotFoundError ¶
func NewFileNotFoundError(name string) FileNotFoundError
NewFileNotFoundError create
type KeyValue ¶
type KeyValue struct { Key string Value interface{} }
func GetKeyValueArray ¶
GetKeyValueArray
func GetKeyValueArrayFromFile ¶
GetKeyValueArrayFromFile
type KeyValueArray ¶
type KeyValueArray struct {
// contains filtered or unexported fields
}
func NewKeyValueArrayFromFile ¶
func NewKeyValueArrayFromFile(location, sep string) (*KeyValueArray, error)
NewKeyValueArrayFromFile
func (*KeyValueArray) Bool ¶
func (kva *KeyValueArray) Bool() bool
func (*KeyValueArray) Float64 ¶
func (kva *KeyValueArray) Float64(dv float64) float64
func (*KeyValueArray) Int ¶
func (kva *KeyValueArray) Int(dv int) int
func (*KeyValueArray) IsContainKey ¶
func (kva *KeyValueArray) IsContainKey(key string) bool
func (*KeyValueArray) Key ¶
func (kva *KeyValueArray) Key() string
func (*KeyValueArray) KeyBool ¶
func (kva *KeyValueArray) KeyBool(key string) bool
func (*KeyValueArray) KeyFloat64 ¶
func (kva *KeyValueArray) KeyFloat64(key string, dv float64) (float64, bool)
func (*KeyValueArray) Keys ¶
func (kva *KeyValueArray) Keys() []string
func (*KeyValueArray) MoveTop ¶
func (kva *KeyValueArray) MoveTop()
func (*KeyValueArray) Next ¶
func (kva *KeyValueArray) Next() bool
func (*KeyValueArray) Put ¶
func (kva *KeyValueArray) Put(key string, value interface{})
func (*KeyValueArray) String ¶
func (kva *KeyValueArray) String() string
func (*KeyValueArray) Value ¶
func (kva *KeyValueArray) Value() interface{}
type KeyValueMap ¶
type KeyValueMap map[string]interface{}
func NewKeyValueMap ¶
func NewKeyValueMap() KeyValueMap
func (KeyValueMap) GetKeys ¶
func (c KeyValueMap) GetKeys() []string
func (KeyValueMap) IsHasKey ¶
func (c KeyValueMap) IsHasKey(key string) bool
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
func NewLocation ¶
type Money ¶
type Money float64
func (Money) MultipleBai ¶
func (Money) MultipleWan ¶
func (Money) MultipleYi ¶
type OutRecorder ¶
func NewHtmlOutRecorder ¶
func NewHtmlOutRecorder(w io.Writer) *OutRecorder
func NewOutRecorder ¶
func NewOutRecorder(w io.Writer, typ string) *OutRecorder
func NewStdOutRecorder ¶
func NewStdOutRecorder() *OutRecorder
func (*OutRecorder) Record ¶
func (r *OutRecorder) Record(err error, okMsg string, args ...interface{})
func (*OutRecorder) RecordMsg ¶
func (r *OutRecorder) RecordMsg(msg string, args ...interface{})
RecordMsg
func (*OutRecorder) Writef ¶
func (r *OutRecorder) Writef(cssClass string, msg string, args ...interface{})
Writef
type Quarter ¶
type Quarter int
func GetCurrentQuarter ¶
func GetCurrentQuarter() Quarter
func GetQuarter ¶
type Results ¶
Results define results
func (*Results) RecordErrorMsg ¶
func (r *Results) RecordErrorMsg(errMsg ...interface{})
RecordErrorMsg record error message
func (*Results) RecordMsg ¶
func (r *Results) RecordMsg(msg ...interface{})
RecordMsg records message
func (*Results) RecordfError ¶
RecordfError record error with format.
func (*Results) RecordfMsg ¶
RecordfMsg record message with format.
type RuntimeException ¶
type RuntimeException struct {
Exception
}
RuntimeException depends on apps, not check.
func NewRuntimeException ¶
func NewRuntimeException(err error) RuntimeException
NewRuntimeException create
func NewRuntimeExceptionf ¶
func NewRuntimeExceptionf(format string, args ...interface{}) RuntimeException
NewRuntimeExceptionf create
type String ¶
type String string
func (String) IsContainIgnoreCase ¶
IsContainIgnoreCase
func (String) IsContainInArray ¶
IsContainInArray
func (String) IsContainInArrayIgnoreCase ¶
IsContainInArrayIgnoreCase
func (String) IsContainsInSepString ¶
IsContainsInSepString
func (String) IsContainsInSepStringIgnoreCase ¶
IsContainsInSepStringIgnoreCase
func (String) IsEqualIgnoreCase ¶
IsEqualIgnoreCase
func (String) IsIdCardNo ¶
func (String) IsInArrayIgnoreCase ¶
IsInArrayIgnoreCase
func (String) IsInIgnoreCase ¶
IsInIgnoreCase is in array ignore case.
func (String) IsInSepString ¶
IsInSepString
func (String) IsInSepStringIgnoreCase ¶
IsInSepStringIgnoreCase
func (String) IsMatchString ¶
func (String) IsMustCompileMatch ¶
func (String) IsNotInArrayIgnoreCase ¶
IsNotInArrayIgnoreCase
func (String) IsNotInIgnoreCase ¶
IsNotInIgnoreCase
func (String) IsNotInSepString ¶
IsNotInSepString
func (String) IsNotInSepStringIgnoreCase ¶
IsNotInSepStringIgnoreCase
func (String) IsPhoneNumber ¶
func (String) IsStartIgnoreCase ¶
IsStartIgnoreCase
func (String) IsStartInIgnoreCase ¶
IsStartInIgnoreCase
func (String) IsStartWith ¶
IsStartWith equal to IsHasPrefix
func (String) IsStartsIgnoreCase ¶
IsStartsIgnoreCase
func (String) IsStartsIgnoreCaseInArray ¶
IsStartsIgnoreCaseInArray
func (String) QuoteToASCII ¶
func (String) ReplaceAllNumber ¶
ReplaceAllNumber Replace all numbers
func (String) ToExcelTime ¶
ToExcelTime string format: int64 days after 1900.01.01 FIXME not work properly
func (String) ToExcelTimeString ¶
func (String) ToFloat32NoError ¶
func (String) ToIntNoError ¶
func (String) TrimEndIndex ¶
TrimEndIndex eg: "a/b/c" TrimEndIndex("/") returns a/b
type StringArray ¶
type StringArray []string
func NewStringArray ¶
func NewStringArray(items ...string) StringArray
func (StringArray) AppendStringArray ¶
func (s StringArray) AppendStringArray(a StringArray) StringArray
func (StringArray) Join ¶
func (s StringArray) Join(sep string) string
func (StringArray) MergeWithOsNewLine ¶
func (s StringArray) MergeWithOsNewLine() string
MergeWithOsNewLine
func (StringArray) RemoveBlank ¶
func (s StringArray) RemoveBlank() (r StringArray)
func (StringArray) RemoveBlankAndComment ¶
func (s StringArray) RemoveBlankAndComment(start string) StringArray
func (StringArray) RemoveBlankAndSharpComment ¶
func (s StringArray) RemoveBlankAndSharpComment() StringArray
func (StringArray) RemoveBlankAndSlashComment ¶
func (s StringArray) RemoveBlankAndSlashComment() StringArray
func (StringArray) RemoveComment ¶
func (s StringArray) RemoveComment(start string) (r StringArray)
func (StringArray) RemoveSharpComment ¶
func (s StringArray) RemoveSharpComment() StringArray
func (StringArray) RemoveSlashComment ¶
func (s StringArray) RemoveSlashComment() StringArray
func (StringArray) RoundJoin ¶
func (s StringArray) RoundJoin(round, sep string) string
example: {"a", "b" , "c"} to "a,b,c"
type StringBuffer ¶
StringBuffer ideas from java StringBuffer.
func NewStringBuffer ¶
func NewStringBuffer(v ...interface{}) (sb StringBuffer)
NewStringBuffer create no args.
func (StringBuffer) AppendArrayCSVLine ¶
func (sb StringBuffer) AppendArrayCSVLine(values []string)
AppendArrayCSVLine append "[a,b,c] as a,b,c\n"
func (StringBuffer) AppendByteArray ¶
func (sb StringBuffer) AppendByteArray(bs []byte)
AppendByteArray append
func (StringBuffer) AppendEachLine ¶
func (sb StringBuffer) AppendEachLine(lines ...interface{})
AppendEachLine append line by line
func (StringBuffer) AppendLine ¶
func (sb StringBuffer) AppendLine(args ...interface{})
AppendLine append line
func (StringBuffer) AppendLinef ¶
func (sb StringBuffer) AppendLinef(format string, args ...interface{})
AppendLinef append line with format
func (StringBuffer) AppendLines ¶
func (sb StringBuffer) AppendLines(lines []string)
AppendLines append lines
func (StringBuffer) Appendf ¶
func (sb StringBuffer) Appendf(format string, args ...interface{})
Appendf appends with format
func (StringBuffer) HTML ¶
func (sb StringBuffer) HTML() template.HTML
HTML returns html template.HTML
func (StringBuffer) WriteTo ¶
func (sb StringBuffer) WriteTo(dest io.Writer) (int64, error)
WriteTo write
func (StringBuffer) WriteToFile ¶
func (sb StringBuffer) WriteToFile(file string) (int64, error)
WriteToFile write to file
type StringKeyValueMap ¶
func NewStringKeyValueMap ¶
func NewStringKeyValueMap() StringKeyValueMap
func (StringKeyValueMap) GetBool ¶
func (c StringKeyValueMap) GetBool(key string) bool
func (StringKeyValueMap) GetInt ¶
func (c StringKeyValueMap) GetInt(key string) int
func (StringKeyValueMap) GetString ¶
func (c StringKeyValueMap) GetString(key string) string
func (StringKeyValueMap) GetStringWithDefault ¶
func (c StringKeyValueMap) GetStringWithDefault(key, defaultValue string) string
func (StringKeyValueMap) IsContain ¶
func (c StringKeyValueMap) IsContain(key string) bool
type Time ¶
func GetCurrentTime ¶
func GetCurrentTime() Time
type WrapArgs ¶
type WrapArgs struct {
// contains filtered or unexported fields
}
WrapArgs wrap renderArgs and args together
func NewWrapArgs ¶
NewWrapArgs creates instance
func (*WrapArgs) GetArgFloat64 ¶
GetArgFloat64 returns Float64
func (*WrapArgs) GetArgString ¶
GetArgString returns name string value
func (*WrapArgs) IsArgExists ¶
IsArgExists returns name exists or not
Source Files ¶
- any.go
- args_parse.go
- args_wrap.go
- array_list.go
- bufstr.go
- common.go
- doc.go
- env.go
- error.go
- error_define.go
- errors_recordor.go
- exec.go
- file.go
- file_line.go
- file_print.go
- filepath.go
- flag.go
- key_value.go
- key_value_array.go
- line.go
- mio.go
- misc.go
- misc_git.go
- name_util.go
- net_util.go
- os.go
- os_args.go
- os_linux.go
- out_record.go
- path.go
- print.go
- random.go
- random_api.go
- reflect_util.go
- runtime.go
- str_util.go
- trans.go
- transform.go
- util.go
- validator_api.go
- validator_email.go
- value.go
- wbool.go
- wbyte.go
- wfile.go
- wfloat.go
- wint.go
- wmap.go
- wmap_string.go
- wmoney.go
- wresult.go
- wrune.go
- wstr_array.go
- wstring.go
- wstring_trans.go
- wstring_validate.go
- wtime.go
Directories ¶
Path | Synopsis |
---|---|
package mcmd.
|
package mcmd. |
mabetle config package.
|
mabetle config package. |
mabetle math functions.
|
mabetle math functions. |
its very interesting and simple for go main file to run all kinds funcs and runable struct.
|
its very interesting and simple for go main file to run all kinds funcs and runable struct. |
sdb define some APIs SimpleTable a csv(or tsv), sheet, database table can abstract to SimpleTable the ideas from jdbc API Next() for loop, and holder a rowIndex RandomAccessTable There is no rowIndex concept, but you can walk rows too with loop.
|
sdb define some APIs SimpleTable a csv(or tsv), sheet, database table can abstract to SimpleTable the ideas from jdbc API Next() for loop, and holder a rowIndex RandomAccessTable There is no rowIndex concept, but you can walk rows too with loop. |
Mabetle Stat Package.
|
Mabetle Stat Package. |
Provide AssertEqual, AssertTrue, AssertFalse for test.
|
Provide AssertEqual, AssertTrue, AssertFalse for test. |