g.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2017 gf Author(https://github.com/gogf/gf). 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 g
  7. import (
  8. "github.com/gogf/gf/container/gvar"
  9. )
  10. // Var is a universal variable interface, like generics.
  11. type Var = gvar.Var
  12. // Frequently-used map type alias.
  13. type Map = map[string]interface{}
  14. type MapAnyAny = map[interface{}]interface{}
  15. type MapAnyStr = map[interface{}]string
  16. type MapAnyInt = map[interface{}]int
  17. type MapStrAny = map[string]interface{}
  18. type MapStrStr = map[string]string
  19. type MapStrInt = map[string]int
  20. type MapIntAny = map[int]interface{}
  21. type MapIntStr = map[int]string
  22. type MapIntInt = map[int]int
  23. type MapAnyBool = map[interface{}]bool
  24. type MapStrBool = map[string]bool
  25. type MapIntBool = map[int]bool
  26. // Frequently-used slice type alias.
  27. type List = []Map
  28. type ListAnyAny = []Map
  29. type ListAnyStr = []MapAnyStr
  30. type ListAnyInt = []MapAnyInt
  31. type ListStrAny = []MapStrAny
  32. type ListStrStr = []MapStrStr
  33. type ListStrInt = []MapStrInt
  34. type ListIntAny = []MapIntAny
  35. type ListIntStr = []MapIntStr
  36. type ListIntInt = []MapIntInt
  37. type ListAnyBool = []MapAnyBool
  38. type ListStrBool = []MapStrBool
  39. type ListIntBool = []MapIntBool
  40. // Frequently-used slice type alias.
  41. type Slice = []interface{}
  42. type SliceAny = []interface{}
  43. type SliceStr = []string
  44. type SliceInt = []int
  45. // Array is alias of Slice.
  46. type Array = []interface{}
  47. type ArrayAny = []interface{}
  48. type ArrayStr = []string
  49. type ArrayInt = []int