Documentation
¶
Overview ¶
LogUtil.go
Index ¶
- Constants
- Variables
- func AppendPrefix(path, prefix string) string
- func AppendSuffix(path, suffix string) string
- func CamelToSnakeCase(text string) string
- func ChangeExtension(path string, newExtension string) string
- func ChangeLogLevel(logLevel int)
- func ChangeLogLevelByText(logLevelText string)
- func GetFiles(path string, allowExtensions []string) []string
- func GetFilesV(path string, allowExtensions ...string) []string
- func GetLogLevel() int
- func GetMIMETypeFromExtension(filePath string) string
- func HasPrefix(s, prefix []rune) bool
- func HasSuffix(s, suffix []rune) bool
- func IndexRunes(s []rune, subRunes []rune) int
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsFile(path string) bool
- func LastIndexRunes(s []rune, subRunes []rune) int
- func LogD(content string)
- func LogE(content string)
- func LogI(content string)
- func LogInit()
- func LogV(content string)
- func LogW(content string)
- func MapKeys(mapObj interface{}) interface{}
- func SnakeToCamelCase(text string) string
- func Split(originalText string, sepTextArray []string, invalidSpaceStarters []rune, ...) [][]rune
- func ToLowerFirst(text string) string
- func ToUpperFirst(text string) string
- func Version() string
- func VersionMajorCode() int
- func VersionMinorCode() int
- func VersionRevisionCode() int
- type ConfigHelper
- type Logger
- func (this Logger) ChangeLogLevel(logLevel int)
- func (this Logger) ChangeLogLevelByText(logLevelText string)
- func (this Logger) GetLogLevel() int
- func (this Logger) LogD(content string)
- func (this Logger) LogE(content string)
- func (this Logger) LogI(content string)
- func (this Logger) LogV(content string)
- func (this Logger) LogW(content string)
- type LoggerIF
- type ReflectHelper
- func (this *ReflectHelper) BoolValue(index int) bool
- func (this *ReflectHelper) Call(methodName string, values []reflect.Value) []reflect.Value
- func (this *ReflectHelper) CanSet(name string, value interface{}) bool
- func (this *ReflectHelper) FloatValue(index int) float64
- func (this *ReflectHelper) GetByIndex(index int) interface{}
- func (this *ReflectHelper) GetByName(name string) interface{}
- func (this *ReflectHelper) GetByTagName(key string, name string) interface{}
- func (this *ReflectHelper) IntValue(index int) int64
- func (this *ReflectHelper) InterfaceName() string
- func (this *ReflectHelper) IsBool(index int) bool
- func (this *ReflectHelper) IsFloat32(index int) bool
- func (this *ReflectHelper) IsFloat64(index int) bool
- func (this *ReflectHelper) IsInt8(index int) bool
- func (this *ReflectHelper) IsInt16(index int) bool
- func (this *ReflectHelper) IsInt32(index int) bool
- func (this *ReflectHelper) IsInt64(index int) bool
- func (this *ReflectHelper) IsString(index int) bool
- func (this *ReflectHelper) IsUint8(index int) bool
- func (this *ReflectHelper) IsUint16(index int) bool
- func (this *ReflectHelper) IsUint32(index int) bool
- func (this *ReflectHelper) IsUint64(index int) bool
- func (this *ReflectHelper) Name(index int) string
- func (this *ReflectHelper) NumField() int
- func (this *ReflectHelper) SetByIndex(index int, value interface{}) bool
- func (this *ReflectHelper) SetByName(name string, value interface{}) bool
- func (this *ReflectHelper) String(index int) string
- func (this *ReflectHelper) StringValue(index int) string
- func (this *ReflectHelper) Tag(index int) reflect.StructTag
- func (this *ReflectHelper) UintValue(index int) uint64
- func (this *ReflectHelper) ValueKind(index int) reflect.Kind
- type ReflectHelperIF
- type StringBuilder
- type StringBuilderIF
Constants ¶
View Source
const LogLevelD = 15
View Source
const LogLevelE = 1
View Source
const LogLevelI = 7
View Source
const LogLevelV = 31
View Source
const LogLevelW = 3
Variables ¶
View Source
var EnableDebug bool = true
Functions ¶
func AppendPrefix ¶ added in v1.7.0
func AppendSuffix ¶ added in v1.7.0
func CamelToSnakeCase ¶ added in v1.1.0
func ChangeExtension ¶ added in v1.6.0
func ChangeLogLevel ¶
func ChangeLogLevel(logLevel int)
func ChangeLogLevelByText ¶ added in v1.4.3
func ChangeLogLevelByText(logLevelText string)
func GetLogLevel ¶
func GetLogLevel() int
func GetMIMETypeFromExtension ¶ added in v1.8.0
func IndexRunes ¶ added in v1.9.0
func LastIndexRunes ¶ added in v1.9.0
func SnakeToCamelCase ¶ added in v1.1.0
func ToLowerFirst ¶ added in v1.2.0
func ToUpperFirst ¶ added in v1.2.0
func VersionMajorCode ¶ added in v1.0.0
func VersionMajorCode() int
func VersionMinorCode ¶ added in v1.0.0
func VersionMinorCode() int
func VersionRevisionCode ¶ added in v1.0.0
func VersionRevisionCode() int
Types ¶
type ConfigHelper ¶ added in v1.4.2
type ConfigHelper struct {
// contains filtered or unexported fields
}
func NewConfigHelper ¶ added in v1.4.2
func NewConfigHelper(configData interface{}, configFilePath string) *ConfigHelper
func (*ConfigHelper) ExpandConfigData ¶ added in v1.4.2
func (helper *ConfigHelper) ExpandConfigData() error
type Logger ¶
type Logger struct {
LogLevel int
// contains filtered or unexported fields
}
func (Logger) ChangeLogLevel ¶
func (Logger) ChangeLogLevelByText ¶ added in v1.4.3
func (Logger) GetLogLevel ¶
type ReflectHelper ¶ added in v0.1.0
type ReflectHelper struct {
// contains filtered or unexported fields
}
func NewReflectHelper ¶ added in v0.1.0
func NewReflectHelper(targetInterface interface{}) *ReflectHelper
func (*ReflectHelper) BoolValue ¶ added in v0.1.0
func (this *ReflectHelper) BoolValue(index int) bool
func (*ReflectHelper) CanSet ¶ added in v0.1.0
func (this *ReflectHelper) CanSet(name string, value interface{}) bool
func (*ReflectHelper) FloatValue ¶ added in v0.1.0
func (this *ReflectHelper) FloatValue(index int) float64
func (*ReflectHelper) GetByIndex ¶ added in v0.1.0
func (this *ReflectHelper) GetByIndex(index int) interface{}
func (*ReflectHelper) GetByName ¶ added in v0.1.0
func (this *ReflectHelper) GetByName(name string) interface{}
func (*ReflectHelper) GetByTagName ¶ added in v1.3.1
func (this *ReflectHelper) GetByTagName(key string, name string) interface{}
func (*ReflectHelper) IntValue ¶ added in v0.1.0
func (this *ReflectHelper) IntValue(index int) int64
func (*ReflectHelper) InterfaceName ¶ added in v0.1.0
func (this *ReflectHelper) InterfaceName() string
func (*ReflectHelper) IsBool ¶ added in v0.1.0
func (this *ReflectHelper) IsBool(index int) bool
func (*ReflectHelper) IsFloat32 ¶ added in v0.1.0
func (this *ReflectHelper) IsFloat32(index int) bool
func (*ReflectHelper) IsFloat64 ¶ added in v0.1.0
func (this *ReflectHelper) IsFloat64(index int) bool
func (*ReflectHelper) IsInt8 ¶ added in v0.1.0
func (this *ReflectHelper) IsInt8(index int) bool
func (*ReflectHelper) IsInt16 ¶ added in v0.1.0
func (this *ReflectHelper) IsInt16(index int) bool
func (*ReflectHelper) IsInt32 ¶ added in v0.1.0
func (this *ReflectHelper) IsInt32(index int) bool
func (*ReflectHelper) IsInt64 ¶ added in v0.1.0
func (this *ReflectHelper) IsInt64(index int) bool
func (*ReflectHelper) IsString ¶ added in v0.1.0
func (this *ReflectHelper) IsString(index int) bool
func (*ReflectHelper) IsUint8 ¶ added in v0.1.0
func (this *ReflectHelper) IsUint8(index int) bool
func (*ReflectHelper) IsUint16 ¶ added in v0.1.0
func (this *ReflectHelper) IsUint16(index int) bool
func (*ReflectHelper) IsUint32 ¶ added in v0.1.0
func (this *ReflectHelper) IsUint32(index int) bool
func (*ReflectHelper) IsUint64 ¶ added in v0.1.0
func (this *ReflectHelper) IsUint64(index int) bool
func (*ReflectHelper) Name ¶ added in v0.1.0
func (this *ReflectHelper) Name(index int) string
func (*ReflectHelper) NumField ¶ added in v0.1.0
func (this *ReflectHelper) NumField() int
func (*ReflectHelper) SetByIndex ¶ added in v0.1.0
func (this *ReflectHelper) SetByIndex(index int, value interface{}) bool
func (*ReflectHelper) SetByName ¶ added in v0.1.0
func (this *ReflectHelper) SetByName(name string, value interface{}) bool
func (*ReflectHelper) String ¶ added in v0.1.0
func (this *ReflectHelper) String(index int) string
func (*ReflectHelper) StringValue ¶ added in v0.1.0
func (this *ReflectHelper) StringValue(index int) string
func (*ReflectHelper) Tag ¶ added in v0.1.0
func (this *ReflectHelper) Tag(index int) reflect.StructTag
func (*ReflectHelper) UintValue ¶ added in v0.1.0
func (this *ReflectHelper) UintValue(index int) uint64
type ReflectHelperIF ¶ added in v0.1.0
type ReflectHelperIF interface {
NumField() int
InterfaceName() string
Name(index int) string
Tag(index int) reflect.StructTag
BoolValue(index int) bool
StringValue(index int) string
String(index int) string
IntValue(index int) int64
UintValue(index int) uint64
FloatValue(index int) float64
ValueKind(index int) reflect.Kind
IsBool(index int) bool
IsString(index int) bool
IsInt32(index int) bool
IsInt64(index int) bool
IsUint32(index int) bool
IsUint64(index int) bool
IsFloat32(index int) bool
IsFloat64(index int) bool
SetByName(name string, value interface{})
SetByIndex(index int, value interface{})
GetByName(name string) interface{}
GetByTagName(key string, name string) interface{}
GetByIndex(index int) interface{}
FindByName(name string) bool
Call(methodName string, values []reflect.Value) []reflect.Value
}
type StringBuilder ¶
type StringBuilder struct {
// contains filtered or unexported fields
}
func (*StringBuilder) Append ¶
func (this *StringBuilder) Append(text string) *StringBuilder
func (*StringBuilder) AppendByte ¶ added in v1.1.0
func (this *StringBuilder) AppendByte(text byte) *StringBuilder
func (*StringBuilder) Bytes ¶ added in v1.0.0
func (this *StringBuilder) Bytes() []byte
func (*StringBuilder) Delete ¶
func (this *StringBuilder) Delete()
func (*StringBuilder) Length ¶ added in v1.0.0
func (this *StringBuilder) Length() int
func (*StringBuilder) String ¶
func (this *StringBuilder) String() string
type StringBuilderIF ¶
type StringBuilderIF interface {
Append(text string) StringBuilder
AppendByte(text byte) StringBuilder
Delete()
String() string
Length() int
Bytes() []byte
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.