Documentation
¶
Index ¶
- func CeilingToDay(t time.Time) time.Time
- func Compute[T comparable, R any](a map[T]R, k T, r0 R, fn func(T, R) R) R
- func DiffDays(st, et time.Time) float64
- func EncodeJson(s string) string
- func ExpandEnv(s string) string
- func FileExists(fn string) (bool, error)
- func GetHostAddress(address string) (net.IP, error)
- func GetIdList[T any, ID any](items []T, getId func(T) ID) []ID
- func GetLocalIpAddress() string
- func HasPrefixFold(s, prefix string) bool
- func IntListToStr[T int | int8 | int16 | int32 | int64](l []T) string
- func IsWorkingDay(t time.Time) bool
- func LeftJoin[T1 any, T2 any, ID comparable](items1 []T1, items2 []T2, f1 func(T1) ID, f2 func(T2) ID, f3 func(T1, T2)) int
- func LeftJoin2[T1 any, T2 any](items1 []T1, items2 []T2, f1 func(T1, T2) bool, f2 func(T1, T2)) int
- func LocalDate(year int, month time.Month, day int) time.Time
- func ParseDate(s string, d time.Time) time.Time
- func RecoverAsEleErr[T any](ch chan<- Ele[T])
- func Sha256Salt(s string) string
- func SplitAndTrim(s, sep string) []string
- func SplitAsInt[T int | int8 | int16 | int32 | int64](s, sep string) []T
- func SplitHostPort(host string) (string, uint64)
- func StringListToUpper(sa []string) (result []string)
- func Sum[T any, R int | int8 | int16 | int32 | int64 | float32 | float64](a []T, r0 R, fn func(T) R) R
- func ToStr(o any, ds string) string
- func Today() time.Time
- func TrimPrefixFold(s, prefix string) string
- func TruncateToDay(t time.Time) time.Time
- type AtomicTime
- type Boolean
- func (b Boolean) Coalsece(o bool) bool
- func (b *Boolean) Eq(ov bool) bool
- func (b Boolean) MarshalJSON() ([]byte, error)
- func (b *Boolean) Merge(o Boolean) *Boolean
- func (b *Boolean) Scan(value any) error
- func (b Boolean) String() string
- func (b *Boolean) UnmarshalJSON(data []byte) error
- func (b Boolean) Value() (driver.Value, error)
- type Ele
- type ISODate
- type Integer
- func (i Integer) Coalsece(o int32) int32
- func (i Integer) CoalseceInt(o int) int
- func (i *Integer) Eq(ov int32) bool
- func (i Integer) MarshalJSON() ([]byte, error)
- func (i *Integer) Merge(o Integer) *Integer
- func (i *Integer) Scan(value any) error
- func (i Integer) String() string
- func (i *Integer) UnmarshalJSON(data []byte) error
- func (i Integer) Value() (driver.Value, error)
- type Long
- func (s Long) Coalsece(o int64) int64
- func (l *Long) Eq(ov int64) bool
- func (i Long) MarshalJSON() ([]byte, error)
- func (l *Long) Merge(o Long) *Long
- func (l *Long) Scan(value any) error
- func (l Long) String() string
- func (i *Long) UnmarshalJSON(data []byte) error
- func (l Long) Value() (driver.Value, error)
- type Page
- type PageRequest
- type RollingFileWriter
- type Set
- type Short
- func (s Short) Coalsece(o int16) int16
- func (s *Short) Eq(ov int16) bool
- func (s Short) MarshalJSON() ([]byte, error)
- func (s *Short) Merge(o Short) *Short
- func (s *Short) Scan(value any) error
- func (s Short) String() string
- func (i *Short) UnmarshalJSON(data []byte) error
- func (s Short) Value() (driver.Value, error)
- type String
- func (s String) Coalsece(o string) string
- func (s *String) Eq(ov string) bool
- func (s String) MarshalJSON() ([]byte, error)
- func (s *String) Merge(o String) *String
- func (s *String) Scan(value any) error
- func (s String) String() string
- func (s *String) UnmarshalJSON(data []byte) error
- func (s String) Value() (driver.Value, error)
- type Timestamp
- func (t Timestamp) Coalsece(o time.Time) time.Time
- func (t *Timestamp) Eq(ov time.Time) bool
- func (t Timestamp) MarshalJSON() ([]byte, error)
- func (t *Timestamp) Merge(o Timestamp) *Timestamp
- func (t *Timestamp) Scan(value any) error
- func (t Timestamp) String() string
- func (t *Timestamp) UnmarshalJSON(data []byte) error
- func (t Timestamp) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compute ¶ added in v0.0.3
func Compute[T comparable, R any](a map[T]R, k T, r0 R, fn func(T, R) R) R
func FileExists ¶ added in v0.0.10
func GetHostAddress ¶ added in v0.0.13
GetHostAddress 获取指定地址对应的IP地址。 address 可以是非回环IP地址,或者表示本机的回环地址,或者是主机名。
func GetLocalIpAddress ¶ added in v0.0.13
func GetLocalIpAddress() string
GetLocalIpAddress 获取本地IP地址,此方法会尽可能返回IPv4地址。
func HasPrefixFold ¶ added in v0.0.17
func IntListToStr ¶ added in v0.0.13
func LeftJoin ¶ added in v0.0.18
func LeftJoin[T1 any, T2 any, ID comparable](items1 []T1, items2 []T2, f1 func(T1) ID, f2 func(T2) ID, f3 func(T1, T2)) int
func RecoverAsEleErr ¶
func SplitAsInt ¶
SplitAsInt
func SplitHostPort ¶ added in v0.0.13
SplitHostPort 将主机名与端口号分离。
func StringListToUpper ¶ added in v0.0.13
func TrimPrefixFold ¶ added in v0.0.17
Types ¶
type AtomicTime ¶
type AtomicTime struct {
// contains filtered or unexported fields
}
func NewAtomicTime ¶
func NewAtomicTime(t time.Time) *AtomicTime
func (*AtomicTime) CompareAndMax ¶
func (t *AtomicTime) CompareAndMax(oa ...time.Time) bool
func (*AtomicTime) CompareAndMin ¶
func (t *AtomicTime) CompareAndMin(oa ...time.Time) bool
func (*AtomicTime) Time ¶
func (t *AtomicTime) Time() time.Time
type Boolean ¶ added in v0.0.11
Boolean 表示可以为空的bool
func ParseBoolean ¶ added in v0.0.13
func (Boolean) MarshalJSON ¶ added in v0.0.11
func (*Boolean) UnmarshalJSON ¶ added in v0.0.11
type ISODate ¶ added in v0.0.6
func (ISODate) MarshalJSON ¶ added in v0.0.6
func (*ISODate) UnmarshalJSON ¶ added in v0.0.6
type Integer ¶ added in v0.0.13
Integer 表示可以为空的int32
func ParseInteger ¶ added in v0.0.13
func (Integer) CoalseceInt ¶ added in v0.0.17
func (Integer) MarshalJSON ¶ added in v0.0.13
func (*Integer) UnmarshalJSON ¶ added in v0.0.13
type Long ¶ added in v0.0.13
Long 表示可以为空的int64
func (Long) MarshalJSON ¶ added in v0.0.13
func (*Long) UnmarshalJSON ¶ added in v0.0.13
type Page ¶ added in v0.0.13
type Page[T any] struct { TotalPages int `json:"totalPages"` TotalElements int64 `json:"totalElements"` PageNumber int `json:"number"` PageSize int `json:"size"` NumberOfElements int `json:"numberOfElements"` Content []T `json:"content"` }
Page 表示分页查询结果
type PageRequest ¶ added in v0.0.13
type PageRequest struct { PageNumber int `json:"page"` // 页码,从0开始。 PageSize int `json:"size"` // 每页记录数。 }
PageRequest 表示分页查询请求
func (*PageRequest) GetStartRowIndex ¶ added in v0.0.17
func (pr *PageRequest) GetStartRowIndex() int
type RollingFileWriter ¶ added in v0.0.10
type RollingFileWriter struct { Base string // 日志文件夹。 Prefix string // 日志文件前缀。 // contains filtered or unexported fields }
滚动文件日志记录器。
var ( // 默认的滚动文件日志记录器。 DefaultRollingFileWriter *RollingFileWriter = &RollingFileWriter{ Base: "./log", Prefix: "app", } )
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
Set 表示一个集合。
func NewSet ¶
func NewSet[T comparable](t ...T) *Set[T]
func (*Set[T]) ContainsAny ¶
type Short ¶ added in v0.0.13
Short 表示可以为空的int16
func ParseShort ¶ added in v0.0.13
func (Short) MarshalJSON ¶ added in v0.0.13
func (*Short) UnmarshalJSON ¶ added in v0.0.13
type String ¶ added in v0.0.13
String 表示可以为空的string。
func ParseString ¶ added in v0.0.13
func ParseStringEnum ¶ added in v0.0.14
func (String) MarshalJSON ¶ added in v0.0.13
func (*String) UnmarshalJSON ¶ added in v0.0.13
type Timestamp ¶ added in v0.0.4
Timestamp 表示可以为空的Time
func ParseTimestamp ¶ added in v0.0.13
func (Timestamp) MarshalJSON ¶ added in v0.0.4
func (*Timestamp) UnmarshalJSON ¶ added in v0.0.4
Source Files
¶
Click to show internal directories.
Click to hide internal directories.