2021-01-17 21:46:25 +08:00
|
|
|
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
2020-05-25 14:26:08 +08:00
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
|
|
// If a copy of the MIT was not distributed with this file,
|
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
|
|
|
|
package gconv
|
|
|
|
|
2021-10-11 21:41:56 +08:00
|
|
|
import "github.com/gogf/gf/v2/os/gtime"
|
2021-06-01 19:47:02 +08:00
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iString is used for type assert api for String().
|
|
|
|
type iString interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
String() string
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iBool is used for type assert api for Bool().
|
|
|
|
type iBool interface {
|
2021-03-18 15:21:05 +08:00
|
|
|
Bool() bool
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iInt64 is used for type assert api for Int64().
|
|
|
|
type iInt64 interface {
|
2021-03-18 15:21:05 +08:00
|
|
|
Int64() int64
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iUint64 is used for type assert api for Uint64().
|
|
|
|
type iUint64 interface {
|
2021-03-18 15:21:05 +08:00
|
|
|
Uint64() uint64
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iFloat32 is used for type assert api for Float32().
|
|
|
|
type iFloat32 interface {
|
2021-03-18 15:21:05 +08:00
|
|
|
Float32() float32
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iFloat64 is used for type assert api for Float64().
|
|
|
|
type iFloat64 interface {
|
2021-03-18 15:21:05 +08:00
|
|
|
Float64() float64
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iError is used for type assert api for Error().
|
|
|
|
type iError interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
Error() string
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iBytes is used for type assert api for Bytes().
|
|
|
|
type iBytes interface {
|
2021-03-18 15:21:05 +08:00
|
|
|
Bytes() []byte
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iInterface is used for type assert api for Interface().
|
|
|
|
type iInterface interface {
|
2021-09-15 21:17:45 +08:00
|
|
|
Interface() interface{}
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iInterfaces is used for type assert api for Interfaces().
|
|
|
|
type iInterfaces interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
Interfaces() []interface{}
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iFloats is used for type assert api for Floats().
|
|
|
|
type iFloats interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
Floats() []float64
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iInts is used for type assert api for Ints().
|
|
|
|
type iInts interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
Ints() []int
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iStrings is used for type assert api for Strings().
|
|
|
|
type iStrings interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
Strings() []string
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iUints is used for type assert api for Uints().
|
|
|
|
type iUints interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
Uints() []uint
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iMapStrAny is the interface support for converting struct parameter to map.
|
|
|
|
type iMapStrAny interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
MapStrAny() map[string]interface{}
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iUnmarshalValue is the interface for custom defined types customizing value assignment.
|
|
|
|
// Note that only pointer can implement interface iUnmarshalValue.
|
|
|
|
type iUnmarshalValue interface {
|
2020-05-25 14:26:08 +08:00
|
|
|
UnmarshalValue(interface{}) error
|
|
|
|
}
|
2020-06-16 17:38:05 +08:00
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iUnmarshalText is the interface for custom defined types customizing value assignment.
|
|
|
|
// Note that only pointer can implement interface iUnmarshalText.
|
|
|
|
type iUnmarshalText interface {
|
2020-12-01 15:57:06 +08:00
|
|
|
UnmarshalText(text []byte) error
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iUnmarshalText is the interface for custom defined types customizing value assignment.
|
|
|
|
// Note that only pointer can implement interface iUnmarshalJSON.
|
|
|
|
type iUnmarshalJSON interface {
|
2021-08-17 16:30:47 +08:00
|
|
|
UnmarshalJSON(b []byte) error
|
|
|
|
}
|
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iSet is the interface for custom value assignment.
|
|
|
|
type iSet interface {
|
2020-06-16 17:38:05 +08:00
|
|
|
Set(value interface{}) (old interface{})
|
|
|
|
}
|
2021-06-01 19:47:02 +08:00
|
|
|
|
2021-09-17 19:26:56 +08:00
|
|
|
// iGTime is the interface for gtime.Time converting.
|
|
|
|
type iGTime interface {
|
2021-06-01 19:47:02 +08:00
|
|
|
GTime(format ...string) *gtime.Time
|
|
|
|
}
|