gconv_interface.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. package gconv
  7. import "github.com/gogf/gf/v2/os/gtime"
  8. // iVal is used for type assert api for String().
  9. type iVal interface {
  10. Val() interface{}
  11. }
  12. // iString is used for type assert api for String().
  13. type iString interface {
  14. String() string
  15. }
  16. // iBool is used for type assert api for Bool().
  17. type iBool interface {
  18. Bool() bool
  19. }
  20. // iInt64 is used for type assert api for Int64().
  21. type iInt64 interface {
  22. Int64() int64
  23. }
  24. // iUint64 is used for type assert api for Uint64().
  25. type iUint64 interface {
  26. Uint64() uint64
  27. }
  28. // iFloat32 is used for type assert api for Float32().
  29. type iFloat32 interface {
  30. Float32() float32
  31. }
  32. // iFloat64 is used for type assert api for Float64().
  33. type iFloat64 interface {
  34. Float64() float64
  35. }
  36. // iError is used for type assert api for Error().
  37. type iError interface {
  38. Error() string
  39. }
  40. // iBytes is used for type assert api for Bytes().
  41. type iBytes interface {
  42. Bytes() []byte
  43. }
  44. // iInterface is used for type assert api for Interface().
  45. type iInterface interface {
  46. Interface() interface{}
  47. }
  48. // iInterfaces is used for type assert api for Interfaces().
  49. type iInterfaces interface {
  50. Interfaces() []interface{}
  51. }
  52. // iFloats is used for type assert api for Floats().
  53. type iFloats interface {
  54. Floats() []float64
  55. }
  56. // iInts is used for type assert api for Ints().
  57. type iInts interface {
  58. Ints() []int
  59. }
  60. // iStrings is used for type assert api for Strings().
  61. type iStrings interface {
  62. Strings() []string
  63. }
  64. // iUints is used for type assert api for Uints().
  65. type iUints interface {
  66. Uints() []uint
  67. }
  68. // iMapStrAny is the interface support for converting struct parameter to map.
  69. type iMapStrAny interface {
  70. MapStrAny() map[string]interface{}
  71. }
  72. // iUnmarshalValue is the interface for custom defined types customizing value assignment.
  73. // Note that only pointer can implement interface iUnmarshalValue.
  74. type iUnmarshalValue interface {
  75. UnmarshalValue(interface{}) error
  76. }
  77. // iUnmarshalText is the interface for custom defined types customizing value assignment.
  78. // Note that only pointer can implement interface iUnmarshalText.
  79. type iUnmarshalText interface {
  80. UnmarshalText(text []byte) error
  81. }
  82. // iUnmarshalText is the interface for custom defined types customizing value assignment.
  83. // Note that only pointer can implement interface iUnmarshalJSON.
  84. type iUnmarshalJSON interface {
  85. UnmarshalJSON(b []byte) error
  86. }
  87. // iSet is the interface for custom value assignment.
  88. type iSet interface {
  89. Set(value interface{}) (old interface{})
  90. }
  91. // iGTime is the interface for gtime.Time converting.
  92. type iGTime interface {
  93. GTime(format ...string) *gtime.Time
  94. }