Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(x int) int
- func Abs64(x int64) int64
- func AnyIndirect(v reflect.Value) reflect.Value
- func AsyncInvokeWithTimeout(timeout time.Duration, args ...func()) bool
- func AsyncInvokesWithTimeout(timeout time.Duration, fs []func()) bool
- func AutoGenTags(vo interface{}, tagDefs map[string]TAG_STYLE) string
- func BaseConvert(src interface{}, dstType reflect.Type) interface{}
- func CheckKeyValueExpected(keyValues map[string]string, keyName, defaultKeyValue string, ...) bool
- func ComposeKey(keys ...string) string
- func ContextWithTrace() context.Context
- func ContextWithTsTrace() context.Context
- func ConvertFieldStyle(str string, style TAG_STYLE) string
- func CopyStruct(src, dest interface{}, f StructConvFunc) error
- func CopyStructDefault(src, dest interface{}) error
- func CopyStructs(src, dest interface{}, f StructConvFunc) error
- func CopyStructsDefault(src, dest interface{}) error
- func CreateModel(name string) interface{}
- func CreateModels(name string) interface{}
- func FileCopy(src, dst string) error
- func FileExist(filePath string) bool
- func FileExt(filePath string) string
- func GBK2UTF8(s []byte) ([]byte, error)
- func GetCurrPath() string
- func GetModelNames() []string
- func GetRegModel(name string) interface{}
- func GetRegModelType(modelName string) reflect.Type
- func GetRegModels() []interface{}
- func IsGBK(data []byte) bool
- func IsModelHasField(modelName string, fieldName string) bool
- func IsNil(value interface{}) bool
- func IsUtf8(data []byte) bool
- func MD5(origStr string) string
- func Max(x, y int) int
- func Max64(x, y int64) int64
- func MaxU(x, y uint32) uint32
- func MergeStructs(src, dest interface{}, f StructConvFunc, keyField string, ...) error
- func Min(x, y int) int
- func Min64(x, y int64) int64
- func MinU(x, y uint32) uint32
- func NanoTsBase36() string
- func ParseContentByTag(content, tagStart, tagEnd string) (string, int)
- func RandBase36() string
- func ReadImage(filePath string) (image.Image, error)
- func RegisterModels(models ...interface{})
- func SafeIsNil(value *reflect.Value) bool
- func StringsExcept(ss1 []string, ss2 []string) (se []string)
- func StringsInArray(s []string, e string) (bool, int)
- func StringsReverse(s []string) []string
- func UTF82GBK(s []byte) ([]byte, error)
- func WriteImage(img image.Image, filePath string) error
- type FileOffsetWriter
- type HttpDownloader
- type StructConvFunc
- type TAG_STYLE
Constants ¶
View Source
const ( STRUCT_DATE_TIME_FORMAT_LAYOUT = "2006-01-02 15:04:05" STRUCT_DATE_FORMAT_LAYOUT = "2006-01-02" )
Variables ¶
View Source
var ( TAG_STYLE_NONE = 0 TAG_STYLE_ORIG = 1 TAG_STYLE_SNAKE = 2 TAG_STYLE_UNDERLINE = 3 )
View Source
var (
StructTimeType = reflect.TypeOf(time.Now())
)
Functions ¶
func AsyncInvokeWithTimeout ¶
usage: var respInfos []string
result := AsyncInvokeWithTimeout(time.Second*4, func() { time.Sleep(time.Second*2) respInfos = []string{"we add1","we add2"} fmt.Println("1done") },func() {
time.Sleep(time.Second*1) //respInfos = append(respInfos,"we add3") fmt.Println("2done") })
fmt.Println("1alldone:",result)
func AsyncInvokesWithTimeout ¶
func AutoGenTags ¶
func BaseConvert ¶
func CheckKeyValueExpected ¶
func CheckKeyValueExpected(keyValues map[string]string, keyName, defaultKeyValue string, expectKeyValues []string) bool
检查keyname的keyvalue是否符合预期值expectKeyValues,如果不存在keyvalue,使用defaultKeyValue判断
func ComposeKey ¶
func ContextWithTrace ¶
func ContextWithTsTrace ¶ added in v1.1.14
func ConvertFieldStyle ¶
func CopyStructDefault ¶
func CopyStructDefault(src, dest interface{}) error
func CopyStructsDefault ¶
func CopyStructsDefault(src, dest interface{}) error
func CreateModel ¶
func CreateModel(name string) interface{}
func GetCurrPath ¶ added in v1.0.14
func GetCurrPath() string
func GetModelNames ¶
func GetModelNames() []string
func GetRegModel ¶
func GetRegModel(name string) interface{}
func GetRegModelType ¶
func GetRegModels ¶
func GetRegModels() []interface{}
func IsModelHasField ¶
func MergeStructs ¶
func MergeStructs(src, dest interface{}, f StructConvFunc, keyField string, fieldMapping ...string) error
func NanoTsBase36 ¶ added in v1.1.28
func NanoTsBase36() string
func ParseContentByTag ¶ added in v1.0.14
func RandBase36 ¶ added in v1.1.28
func RandBase36() string
func RegisterModels ¶
func RegisterModels(models ...interface{})
func StringsExcept ¶
func StringsReverse ¶
Types ¶
type FileOffsetWriter ¶ added in v1.1.34
type FileOffsetWriter struct {
// contains filtered or unexported fields
}
FileOffsetWriter is a writer that writes data to a file at a given file offset.
func NewOffsetWriter ¶ added in v1.1.34
NewOffsetWriter creates a new FileOffsetWriter instance to write at the given offset to the file.
func (*FileOffsetWriter) ResetOffset ¶ added in v1.1.34
func (w *FileOffsetWriter) ResetOffset()
type HttpDownloader ¶ added in v1.1.34
type StructConvFunc ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321.
|
Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321. |
Package snowflake provides a very simple Twitter snowflake generator and parser.
|
Package snowflake provides a very simple Twitter snowflake generator and parser. |
Click to show internal directories.
Click to hide internal directories.