github.com/gogf/gf@v1.16.9/util/gconv/gconv_interface.go (about) 1 // Copyright GoFrame Author(https://goframe.org). All Rights Reserved. 2 // 3 // This Source Code Form is subject to the terms of the MIT License. 4 // If a copy of the MIT was not distributed with this file, 5 // You can obtain one at https://github.com/gogf/gf. 6 7 package gconv 8 9 import "github.com/gogf/gf/os/gtime" 10 11 // apiString is used for type assert api for String(). 12 type apiString interface { 13 String() string 14 } 15 16 // apiBool is used for type assert api for Bool(). 17 type apiBool interface { 18 Bool() bool 19 } 20 21 // apiInt64 is used for type assert api for Int64(). 22 type apiInt64 interface { 23 Int64() int64 24 } 25 26 // apiUint64 is used for type assert api for Uint64(). 27 type apiUint64 interface { 28 Uint64() uint64 29 } 30 31 // apiFloat32 is used for type assert api for Float32(). 32 type apiFloat32 interface { 33 Float32() float32 34 } 35 36 // apiFloat64 is used for type assert api for Float64(). 37 type apiFloat64 interface { 38 Float64() float64 39 } 40 41 // apiError is used for type assert api for Error(). 42 type apiError interface { 43 Error() string 44 } 45 46 // apiBytes is used for type assert api for Bytes(). 47 type apiBytes interface { 48 Bytes() []byte 49 } 50 51 // apiInterfaces is used for type assert api for Interfaces(). 52 type apiInterfaces interface { 53 Interfaces() []interface{} 54 } 55 56 // apiFloats is used for type assert api for Floats(). 57 type apiFloats interface { 58 Floats() []float64 59 } 60 61 // apiInts is used for type assert api for Ints(). 62 type apiInts interface { 63 Ints() []int 64 } 65 66 // apiStrings is used for type assert api for Strings(). 67 type apiStrings interface { 68 Strings() []string 69 } 70 71 // apiUints is used for type assert api for Uints(). 72 type apiUints interface { 73 Uints() []uint 74 } 75 76 // apiMapStrAny is the interface support for converting struct parameter to map. 77 type apiMapStrAny interface { 78 MapStrAny() map[string]interface{} 79 } 80 81 // apiUnmarshalValue is the interface for custom defined types customizing value assignment. 82 // Note that only pointer can implement interface apiUnmarshalValue. 83 type apiUnmarshalValue interface { 84 UnmarshalValue(interface{}) error 85 } 86 87 // apiUnmarshalText is the interface for custom defined types customizing value assignment. 88 // Note that only pointer can implement interface apiUnmarshalText. 89 type apiUnmarshalText interface { 90 UnmarshalText(text []byte) error 91 } 92 93 // apiUnmarshalText is the interface for custom defined types customizing value assignment. 94 // Note that only pointer can implement interface apiUnmarshalJSON. 95 type apiUnmarshalJSON interface { 96 UnmarshalJSON(b []byte) error 97 } 98 99 // apiSet is the interface for custom value assignment. 100 type apiSet interface { 101 Set(value interface{}) (old interface{}) 102 } 103 104 // apiGTime is the interface for gtime.Time converting. 105 type apiGTime interface { 106 GTime(format ...string) *gtime.Time 107 }