utility

package module
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 21 Imported by: 10

README

GoLang_Utility

It provides following utility class

  • StringBuilder: like StringBuilder on Java, but it has only minimum functions for me
  • LogUtil: for management output log

Version history

  • 2016.03.18 v0.0.1: release
  • 2017.11.28 v0.0.2: bug fix
  • 2018.02.08 v0.1.0: add ReflectHelper
  • 2018.02.09 v1.0.0: add unit test

Documentation

Overview

LogUtil.go

Index

Constants

View Source
const CUIParamExpectExist = "exist"
View Source
const CUIParamExpectFile = "file"
View Source
const CUIParamExpectFolder = "folder"
View Source
const CUIParamExpectIn = "in("
View Source
const CUIParamExpectNotExist = "not_exist"
View Source
const Cr = "\r"
View Source
const CrLf = Cr + Lf
View Source
const Lf = "\n"
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
View Source
const PwValidLargeAlpha = 2
View Source
const PwValidNumeric = 4
View Source
const PwValidSmallAlpha = 1
View Source
const PwValidSymbol = 8

Variables

View Source
var EnableDebug bool = true
View Source
var NotFoundErr = fmt.Errorf("not found the value")

Functions

func AppendPrefix added in v1.7.0

func AppendPrefix(path, prefix string) string

func AppendSuffix added in v1.7.0

func AppendSuffix(path, suffix string) string

func CallAfterDelay added in v1.10.0

func CallAfterDelay(delayTime time.Duration, funcValue reflect.Value, parameters ...interface{}) []reflect.Value

func CallAfterRandomDelay added in v1.10.0

func CallAfterRandomDelay(funcValue reflect.Value, parameters ...interface{}) []reflect.Value

func CamelToSnakeCase added in v1.1.0

func CamelToSnakeCase(text string) string

func ChangeExtension added in v1.6.0

func ChangeExtension(path string, newExtension string) string

func ChangeLogLevel

func ChangeLogLevel(logLevel int)

func ChangeLogLevelByText added in v1.4.3

func ChangeLogLevelByText(logLevelText string)

func ChangeOutput added in v1.10.0

func ChangeOutput(outputFile string)

func CreatePassword added in v1.10.0

func CreatePassword(length int, validTypes ...int) string

func ExchangeAlphabetToHalfAlphabet added in v1.13.0

func ExchangeAlphabetToHalfAlphabet(originalText string) string

func ExchangeHalfAlphabetToAlphabet added in v1.13.0

func ExchangeHalfAlphabetToAlphabet(originalText string) string

func ExchangeHalfKanaToKana added in v1.13.0

func ExchangeHalfKanaToKana(originalText string) string

func ExchangeHalfNumberToNumber added in v1.13.0

func ExchangeHalfNumberToNumber(originalText string) string

func ExchangeHalfSpaceToSpace added in v1.13.0

func ExchangeHalfSpaceToSpace(originalText string) string

func ExchangeHalfSymbolToSymbol added in v1.13.0

func ExchangeHalfSymbolToSymbol(originalText string) string

func ExchangeHiraganaToKana added in v1.13.0

func ExchangeHiraganaToKana(originalText string) string

func ExchangeKanaToHiragana added in v1.13.0

func ExchangeKanaToHiragana(originalText string) string

func ExchangeNFCtoNFD added in v1.13.0

func ExchangeNFCtoNFD(originalText string) string

func ExchangeNFDtoNFC added in v1.13.0

func ExchangeNFDtoNFC(originalText string) string

func ExchangeNumberToHalfNumber added in v1.13.0

func ExchangeNumberToHalfNumber(originalText string) string

func ExchangePath added in v1.13.0

func ExchangePath(originalPath string) string

func ExchangeRomanNumberToHalfNumber added in v1.13.0

func ExchangeRomanNumberToHalfNumber(originalText string) string

func ExchangeSpaceToHalfSpace added in v1.13.0

func ExchangeSpaceToHalfSpace(originalText string) string

func ExchangeSymbolToHalfSymbol added in v1.13.0

func ExchangeSymbolToHalfSymbol(originalText string) string

func GetCUIParameter added in v1.10.0

func GetCUIParameter(receiver interface{}, debug bool) []error

func GetFiles added in v1.6.0

func GetFiles(path string, allowExtensions []string) []string

func GetFilesV added in v1.6.1

func GetFilesV(path string, allowExtensions ...string) []string

func GetInterface added in v1.10.0

func GetInterface(mapObject interface{}, key interface{}) (interface{}, error)

func GetLogLevel

func GetLogLevel() int

func GetMIMETypeFromExtension added in v1.8.0

func GetMIMETypeFromExtension(filePath string) string

func GetNumber added in v1.10.0

func GetNumber(mapObject interface{}, key interface{}) (float64, error)

func GetParent added in v1.10.0

func GetParent(itemPath string) string

func GetRealFilepath added in v1.13.0

func GetRealFilepath(filePath string, ignoreNameCase, ignoreExtCase bool) (outputFilepath string, exist bool)

func GetString added in v1.10.0

func GetString(mapObject interface{}, key interface{}) (string, error)

func GetUserInput added in v1.10.0

func GetUserInput(prefix string, caseSensitive bool, inputHandler *InputHandler, otherInputHandlers ...(*InputHandler)) (userInput string, ret bool)

func HasPrefix added in v1.9.0

func HasPrefix(s, prefix []rune) bool

func HasSuffix added in v1.9.0

func HasSuffix(s, suffix []rune) bool

func IndexRunes added in v1.9.0

func IndexRunes(s []rune, subRunes []rune) int

func IsDir added in v1.6.0

func IsDir(path string) bool

func IsExist added in v1.6.0

func IsExist(path string) bool

func IsFile added in v1.6.0

func IsFile(path string) bool

func IsFileByFileInfo added in v1.10.0

func IsFileByFileInfo(fileInfo os.FileInfo) bool

func IsNotFound added in v1.10.0

func IsNotFound(err error) bool
func IsSymlink(path string) bool

func IsSymlinkByFileInfo added in v1.10.0

func IsSymlinkByFileInfo(fileInfo os.FileInfo) bool

func JoinPath added in v1.19.0

func JoinPath(base string, separator string, parts ...string) string

func LastIndexRunes added in v1.9.0

func LastIndexRunes(s []rune, subRunes []rune) int

func LogD

func LogD(content string)

func LogE

func LogE(content string)

func LogI

func LogI(content string)

func LogInit

func LogInit()

func LogV

func LogV(content string)

func LogW

func LogW(content string)

func LogfD added in v1.10.0

func LogfD(format string, args ...interface{})

func LogfE added in v1.10.0

func LogfE(format string, args ...interface{})

func LogfI added in v1.10.0

func LogfI(format string, args ...interface{})

func LogfV added in v1.10.0

func LogfV(format string, args ...interface{})

func LogfW added in v1.10.0

func LogfW(format string, args ...interface{})

func MapKeys added in v1.6.0

func MapKeys(mapObj interface{}) interface{}

func Open added in v1.13.0

func Open(filePath string) (*os.File, error)

func OpenFile added in v1.13.0

func OpenFile(filePath string, flag int, perm os.FileMode) (*os.File, error)

func ParseNumber added in v1.10.0

func ParseNumber(str string) (float64, error)

func PrepareOutputFilepath added in v1.10.0

func PrepareOutputFilepath(inputTopFolderpath, inputFilepath, outputTopFolderpath, distExtension string) string

func ReadFile added in v1.13.0

func ReadFile(filePath string) ([]byte, error)

func RemoveSliceItem added in v1.10.0

func RemoveSliceItem(slice interface{}, position int) (interface{}, bool)

func SnakeToCamelCase added in v1.1.0

func SnakeToCamelCase(text string) string

func Split added in v1.5.0

func Split(originalText string, sepTextSlice []string, invalidSpaceStarters ...string) []string

func TernaryOpFloat32 added in v1.17.0

func TernaryOpFloat32(conv bool, v1, v2 float32) float32

func TernaryOpFloat32Func added in v1.17.0

func TernaryOpFloat32Func(conv bool, f1, f2 func() float32) float32

func TernaryOpFloat32FuncWithParams added in v1.17.0

func TernaryOpFloat32FuncWithParams(conv bool, f1, f2 func(...interface{}) float32, params ...interface{}) float32

func TernaryOpFloat64 added in v1.17.0

func TernaryOpFloat64(conv bool, v1, v2 float64) float64

func TernaryOpFloat64Func added in v1.17.0

func TernaryOpFloat64Func(conv bool, f1, f2 func() float64) float64

func TernaryOpFloat64FuncWithParams added in v1.17.0

func TernaryOpFloat64FuncWithParams(conv bool, f1, f2 func(...interface{}) float64, params ...interface{}) float64

func TernaryOpInt added in v1.17.0

func TernaryOpInt(conv bool, v1, v2 int) int

func TernaryOpInt8 added in v1.17.0

func TernaryOpInt8(conv bool, v1, v2 int8) int8

func TernaryOpInt8Func added in v1.17.0

func TernaryOpInt8Func(conv bool, f1, f2 func() int8) int8

func TernaryOpInt8FuncWithParams added in v1.17.0

func TernaryOpInt8FuncWithParams(conv bool, f1, f2 func(...interface{}) int8, params ...interface{}) int8

func TernaryOpInt16 added in v1.17.0

func TernaryOpInt16(conv bool, v1, v2 int16) int16

func TernaryOpInt16Func added in v1.17.0

func TernaryOpInt16Func(conv bool, f1, f2 func() int16) int16

func TernaryOpInt16FuncWithParams added in v1.17.0

func TernaryOpInt16FuncWithParams(conv bool, f1, f2 func(...interface{}) int16, params ...interface{}) int16

func TernaryOpInt32 added in v1.17.0

func TernaryOpInt32(conv bool, v1, v2 int32) int32

func TernaryOpInt32Func added in v1.17.0

func TernaryOpInt32Func(conv bool, f1, f2 func() int32) int32

func TernaryOpInt32FuncWithParams added in v1.17.0

func TernaryOpInt32FuncWithParams(conv bool, f1, f2 func(...interface{}) int32, params ...interface{}) int32

func TernaryOpInt64 added in v1.17.0

func TernaryOpInt64(conv bool, v1, v2 int64) int64

func TernaryOpInt64Func added in v1.17.0

func TernaryOpInt64Func(conv bool, f1, f2 func() int64) int64

func TernaryOpInt64FuncWithParams added in v1.17.0

func TernaryOpInt64FuncWithParams(conv bool, f1, f2 func(...interface{}) int64, params ...interface{}) int64

func TernaryOpIntFunc added in v1.17.0

func TernaryOpIntFunc(conv bool, f1, f2 func() int) int

func TernaryOpIntFuncWithParams added in v1.17.0

func TernaryOpIntFuncWithParams(conv bool, f1, f2 func(...interface{}) int, params ...interface{}) int

func TernaryOpInterface added in v1.17.0

func TernaryOpInterface(conv bool, v1, v2 interface{}) interface{}

func TernaryOpInterfaceFunc added in v1.17.0

func TernaryOpInterfaceFunc(conv bool, f1, f2 func() interface{}) interface{}

func TernaryOpInterfaceFuncWithParams added in v1.17.0

func TernaryOpInterfaceFuncWithParams(conv bool, f1, f2 func(...interface{}) interface{}, params ...interface{}) interface{}

func TernaryOpString added in v1.17.0

func TernaryOpString(conv bool, v1, v2 string) string

func TernaryOpStringFunc added in v1.17.0

func TernaryOpStringFunc(conv bool, f1, f2 func() string) string

func TernaryOpStringFuncWithParams added in v1.17.0

func TernaryOpStringFuncWithParams(conv bool, f1, f2 func(...interface{}) string, params ...interface{}) string

func TernaryOpUint added in v1.17.0

func TernaryOpUint(conv bool, v1, v2 uint) uint

func TernaryOpUint8 added in v1.17.0

func TernaryOpUint8(conv bool, v1, v2 uint8) uint8

func TernaryOpUint8Func added in v1.17.0

func TernaryOpUint8Func(conv bool, f1, f2 func() uint8) uint8

func TernaryOpUint8FuncWithParams added in v1.17.0

func TernaryOpUint8FuncWithParams(conv bool, f1, f2 func(...interface{}) uint8, params ...interface{}) uint8

func TernaryOpUint16 added in v1.17.0

func TernaryOpUint16(conv bool, v1, v2 uint16) uint16

func TernaryOpUint16Func added in v1.17.0

func TernaryOpUint16Func(conv bool, f1, f2 func() uint16) uint16

func TernaryOpUint16FuncWithParams added in v1.17.0

func TernaryOpUint16FuncWithParams(conv bool, f1, f2 func(...interface{}) uint16, params ...interface{}) uint16

func TernaryOpUint32 added in v1.17.0

func TernaryOpUint32(conv bool, v1, v2 uint32) uint32

func TernaryOpUint32Func added in v1.17.0

func TernaryOpUint32Func(conv bool, f1, f2 func() uint32) uint32

func TernaryOpUint32FuncWithParams added in v1.17.0

func TernaryOpUint32FuncWithParams(conv bool, f1, f2 func(...interface{}) uint32, params ...interface{}) uint32

func TernaryOpUint64 added in v1.17.0

func TernaryOpUint64(conv bool, v1, v2 uint64) uint64

func TernaryOpUint64Func added in v1.17.0

func TernaryOpUint64Func(conv bool, f1, f2 func() uint64) uint64

func TernaryOpUint64FuncWithParams added in v1.17.0

func TernaryOpUint64FuncWithParams(conv bool, f1, f2 func(...interface{}) uint64, params ...interface{}) uint64

func TernaryOpUintFunc added in v1.17.0

func TernaryOpUintFunc(conv bool, f1, f2 func() uint) uint

func TernaryOpUintFuncWithParams added in v1.17.0

func TernaryOpUintFuncWithParams(conv bool, f1, f2 func(...interface{}) uint, params ...interface{}) uint

func ToBool added in v1.18.0

func ToBool(value *bool, defaultValue bool) (ret bool)

func ToBoolPointer added in v1.18.0

func ToBoolPointer(value bool) *bool

func ToByte added in v1.16.0

func ToByte(value *byte, defaultValue byte) (ret byte)

func ToBytePointer added in v1.16.0

func ToBytePointer(value byte) *byte

func ToFloat32 added in v1.16.0

func ToFloat32(value *float32, defaultValue float32) (ret float32)

func ToFloat32Pointer added in v1.16.0

func ToFloat32Pointer(value float32) *float32

func ToFloat64 added in v1.16.0

func ToFloat64(value *float64, defaultValue float64) (ret float64)

func ToFloat64Pointer added in v1.16.0

func ToFloat64Pointer(value float64) *float64

func ToInt added in v1.16.0

func ToInt(value *int, defaultValue int) (ret int)

func ToInt8 added in v1.16.0

func ToInt8(value *int8, defaultValue int8) (ret int8)

func ToInt8Pointer added in v1.16.0

func ToInt8Pointer(value int8) *int8

func ToInt16 added in v1.16.0

func ToInt16(value *int16, defaultValue int16) (ret int16)

func ToInt16Pointer added in v1.16.0

func ToInt16Pointer(value int16) *int16

func ToInt32 added in v1.16.0

func ToInt32(value *int32, defaultValue int32) (ret int32)

func ToInt32Pointer added in v1.16.0

func ToInt32Pointer(value int32) *int32

func ToInt64 added in v1.16.0

func ToInt64(value *int64, defaultValue int64) (ret int64)

func ToInt64Pointer added in v1.16.0

func ToInt64Pointer(value int64) *int64

func ToIntPointer added in v1.16.0

func ToIntPointer(value int) *int

func ToIntSlice added in v1.13.0

func ToIntSlice(fromInterface interface{}) (ret []int, retErr error)

func ToInterfaceSlice added in v1.13.0

func ToInterfaceSlice(fromInterface interface{}) (ret []interface{}, retErr error)

func ToLowerFirst added in v1.2.0

func ToLowerFirst(text string) string

func ToString added in v1.16.0

func ToString(value *string, defaultValue string) (ret string)

func ToStringPointer added in v1.16.0

func ToStringPointer(value string) *string

func ToUint added in v1.16.0

func ToUint(value *uint, defaultValue uint) (ret uint)

func ToUint8 added in v1.16.0

func ToUint8(value *uint8, defaultValue uint8) (ret uint8)

func ToUint8Pointer added in v1.16.0

func ToUint8Pointer(value uint8) *uint8

func ToUint16 added in v1.16.0

func ToUint16(value *uint16, defaultValue uint16) (ret uint16)

func ToUint16Pointer added in v1.16.0

func ToUint16Pointer(value uint16) *uint16

func ToUint32 added in v1.16.0

func ToUint32(value *uint32, defaultValue uint32) (ret uint32)

func ToUint32Pointer added in v1.16.0

func ToUint32Pointer(value uint32) *uint32

func ToUint64 added in v1.16.0

func ToUint64(value *uint64, defaultValue uint64) (ret uint64)

func ToUint64Pointer added in v1.16.0

func ToUint64Pointer(value uint64) *uint64

func ToUintPointer added in v1.16.0

func ToUintPointer(value uint) *uint

func ToUpperFirst added in v1.2.0

func ToUpperFirst(text string) string

func UseStdout added in v1.12.0

func UseStdout(useStdout bool)

func Version added in v1.0.0

func Version() string

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

func (*ConfigHelper) ExpandConfigData2 added in v1.9.1

func (helper *ConfigHelper) ExpandConfigData2() (error, bool)

func (*ConfigHelper) StoreConfigData added in v1.10.0

func (helper *ConfigHelper) StoreConfigData() error

type FormData added in v1.10.0

type FormData struct {
	// contains filtered or unexported fields
}

func (*FormData) Filename added in v1.10.0

func (formData *FormData) Filename() string

func (*FormData) MimeType added in v1.10.0

func (formData *FormData) MimeType() string

func (*FormData) Part added in v1.10.0

func (formData *FormData) Part() ([]byte, error)

type InputHandler added in v1.10.0

type InputHandler struct {
	Key     string
	Handler func(string) bool
}

type InterfaceHelper added in v1.10.0

type InterfaceHelper struct {
	// contains filtered or unexported fields
}

func NewInterfaceHelper added in v1.10.0

func NewInterfaceHelper(valueInterface interface{}) *InterfaceHelper

func (*InterfaceHelper) GetBool added in v1.10.0

func (helper *InterfaceHelper) GetBool() (bool, bool)

func (*InterfaceHelper) GetBoolArray added in v1.10.0

func (helper *InterfaceHelper) GetBoolArray() ([]bool, bool)

func (*InterfaceHelper) GetInterfaceArray added in v1.13.0

func (helper *InterfaceHelper) GetInterfaceArray() ([]interface{}, bool)

func (*InterfaceHelper) GetKind added in v1.10.0

func (helper *InterfaceHelper) GetKind() reflect.Kind

func (*InterfaceHelper) GetNumber added in v1.10.0

func (helper *InterfaceHelper) GetNumber() (float64, bool)

func (*InterfaceHelper) GetNumberArray added in v1.10.0

func (helper *InterfaceHelper) GetNumberArray() ([]float64, bool)

func (*InterfaceHelper) GetString added in v1.10.0

func (helper *InterfaceHelper) GetString() (string, bool)

func (*InterfaceHelper) GetStringArray added in v1.10.0

func (helper *InterfaceHelper) GetStringArray() ([]string, bool)

func (*InterfaceHelper) GetTime added in v1.11.0

func (helper *InterfaceHelper) GetTime() (time.Time, bool)

func (*InterfaceHelper) GetTimeArray added in v1.11.0

func (helper *InterfaceHelper) GetTimeArray() ([]time.Time, bool)

func (*InterfaceHelper) IsArrayOrSlice added in v1.10.0

func (helper *InterfaceHelper) IsArrayOrSlice() bool

func (*InterfaceHelper) IsBool added in v1.10.0

func (helper *InterfaceHelper) IsBool() bool

func (*InterfaceHelper) IsFloat added in v1.10.0

func (helper *InterfaceHelper) IsFloat() bool

func (*InterfaceHelper) IsInt added in v1.10.0

func (helper *InterfaceHelper) IsInt() bool

func (*InterfaceHelper) IsNumber added in v1.10.0

func (helper *InterfaceHelper) IsNumber() bool

func (*InterfaceHelper) IsString added in v1.10.0

func (helper *InterfaceHelper) IsString() bool

func (*InterfaceHelper) IsTime added in v1.11.0

func (helper *InterfaceHelper) IsTime() bool

func (*InterfaceHelper) IsUint added in v1.10.0

func (helper *InterfaceHelper) IsUint() bool

func (*InterfaceHelper) Set added in v1.10.0

func (helper *InterfaceHelper) Set(from interface{}) bool

type Logger

type Logger struct {
	LogLevel int
	// contains filtered or unexported fields
}

func (*Logger) ChangeLogLevel

func (this *Logger) ChangeLogLevel(logLevel int)

func (*Logger) ChangeLogLevelByText added in v1.4.3

func (this *Logger) ChangeLogLevelByText(logLevelText string)

func (*Logger) ChangeOutput added in v1.10.0

func (this *Logger) ChangeOutput(outputFile string)

func (*Logger) GetLogLevel

func (this *Logger) GetLogLevel() int

func (*Logger) LogD

func (this *Logger) LogD(content string)

func (*Logger) LogE

func (this *Logger) LogE(content string)

func (*Logger) LogI

func (this *Logger) LogI(content string)

func (*Logger) LogV

func (this *Logger) LogV(content string)

func (*Logger) LogW

func (this *Logger) LogW(content string)

func (*Logger) LogfD added in v1.10.0

func (this *Logger) LogfD(format string, args ...interface{})

func (*Logger) LogfE added in v1.10.0

func (this *Logger) LogfE(format string, args ...interface{})

func (*Logger) LogfI added in v1.10.0

func (this *Logger) LogfI(format string, args ...interface{})

func (*Logger) LogfV added in v1.10.0

func (this *Logger) LogfV(format string, args ...interface{})

func (*Logger) LogfW added in v1.10.0

func (this *Logger) LogfW(format string, args ...interface{})

func (*Logger) UseStdout added in v1.12.0

func (this *Logger) UseStdout(useStdout bool)

type LoggerIF

type LoggerIF interface {
	GetLogLevel() int
	ChangeLogLevel(logLevel int)
	LogV(content string)
	LogD(content string)
	LogI(content string)
	LogW(content string)
	LogE(content string)
	// contains filtered or unexported methods
}

type MultipartHelper added in v1.10.0

type MultipartHelper struct {
	// contains filtered or unexported fields
}

func NewMultipartHelper added in v1.10.0

func NewMultipartHelper(reader io.Reader, boundary string) (*MultipartHelper, error)

func NewMultipartHelperFromHttpRequest added in v1.10.0

func NewMultipartHelperFromHttpRequest(r *http.Request) (*MultipartHelper, error)

func (*MultipartHelper) Close added in v1.10.0

func (helper *MultipartHelper) Close() error

func (*MultipartHelper) Count added in v1.10.0

func (helper *MultipartHelper) Count() int

func (*MultipartHelper) GetByIndex added in v1.10.0

func (helper *MultipartHelper) GetByIndex(index int) (*FormData, error)

func (*MultipartHelper) GetByName added in v1.10.0

func (helper *MultipartHelper) GetByName(partName string) (*FormData, error)

func (*MultipartHelper) PartNames added in v1.10.0

func (helper *MultipartHelper) PartNames() []string

type RangeValue added in v1.10.0

type RangeValue struct {
	// contains filtered or unexported fields
}

func ParseNumberRange added in v1.10.0

func ParseNumberRange(str string) (value *RangeValue, retErr error)

func (*RangeValue) In added in v1.10.0

func (rValue *RangeValue) In(targetValue float64) bool

func (*RangeValue) Out added in v1.10.0

func (rValue *RangeValue) Out(targetValue float64) bool

type ReadHelper added in v1.13.0

type ReadHelper struct {
	// contains filtered or unexported fields
}

func NewReadHelper added in v1.13.0

func NewReadHelper(reader io.Reader) *ReadHelper

func NewReadHelperFromFile added in v1.13.0

func NewReadHelperFromFile(filePath string) (ret *ReadHelper, retErr error)

func NewReadHelperFromReadCloser added in v1.13.0

func NewReadHelperFromReadCloser(reader io.ReadCloser) *ReadHelper

func (*ReadHelper) Close added in v1.13.0

func (helper *ReadHelper) Close() (ret error)

func (*ReadHelper) LineSeparator added in v1.14.0

func (helper *ReadHelper) LineSeparator(lineSeparator string) string

func (*ReadHelper) ReadLine added in v1.13.0

func (helper *ReadHelper) ReadLine() (ret string, retErr error)

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) Call added in v1.3.0

func (this *ReflectHelper) Call(methodName string, values []reflect.Value) []reflect.Value

func (*ReflectHelper) CanSet added in v0.1.0

func (this *ReflectHelper) CanSet(name string, value interface{}) bool

func (*ReflectHelper) FieldIndex added in v1.10.0

func (this *ReflectHelper) FieldIndex(name string) int

func (*ReflectHelper) FieldName added in v1.10.0

func (this *ReflectHelper) FieldName(index int) string

func (*ReflectHelper) FloatValue added in v0.1.0

func (this *ReflectHelper) FloatValue(index int) float64

func (*ReflectHelper) GetAddrByIndex added in v1.10.0

func (this *ReflectHelper) GetAddrByIndex(index int) reflect.Value

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) GetPtrByIndex added in v1.10.0

func (this *ReflectHelper) GetPtrByIndex(index int) reflect.Value

func (*ReflectHelper) GetValueByIndex added in v1.10.0

func (this *ReflectHelper) GetValueByIndex(index int) reflect.Value

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) IsFloat added in v1.10.0

func (this *ReflectHelper) IsFloat(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) IsInt added in v1.10.0

func (this *ReflectHelper) IsInt(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) IsIntUint added in v1.10.0

func (this *ReflectHelper) IsIntUint(index int) bool

func (*ReflectHelper) IsNumber added in v1.10.0

func (this *ReflectHelper) IsNumber(index int) bool

func (*ReflectHelper) IsString added in v0.1.0

func (this *ReflectHelper) IsString(index int) bool

func (*ReflectHelper) IsTime added in v1.10.0

func (this *ReflectHelper) IsTime(index int) bool

func (*ReflectHelper) IsUint added in v1.10.0

func (this *ReflectHelper) IsUint(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) 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, valueInf 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) TimeValue added in v1.10.0

func (this *ReflectHelper) TimeValue(index int) time.Time

func (*ReflectHelper) UintValue added in v0.1.0

func (this *ReflectHelper) UintValue(index int) uint64

func (*ReflectHelper) ValueKind added in v0.1.0

func (this *ReflectHelper) ValueKind(index int) reflect.Kind

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) Appendf added in v1.10.0

func (this *StringBuilder) Appendf(fmtText string, params ...interface{}) *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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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