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