gconv_interface.go 2.7 KB

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