Documentation
¶
Index ¶
- Constants
- func Bool(v *bool) bool
- func BoolPtr(v bool) *bool
- func Float64(v *float64) float64
- func Float64NoZero(v float64) bool
- func Float64Ptr(v float64) *float64
- func Int(v *int) int
- func Int64(v *int64) int64
- func Int64NoZero(v int64) bool
- func Int64Ptr(v int64) *int64
- func IntPtr(v int) *int
- func String(v *string) string
- func StringPtr(v string) *string
- func Time(v *time.Time) time.Time
- func TimePtr(v time.Time) *time.Time
- func UInt64NoZero(v uint64) bool
- func Uint(v *uint) uint
- func Uint64(v *uint64) uint64
- func Uint64Ptr(v uint64) *uint64
- func UintPtr(v uint) *uint
- type Bools
- func (s *Bools) Add(values ...bool)
- func (s Bools) Contains(values ...bool) bool
- func (s Bools) ContainsOneOf(values ...bool) bool
- func (s Bools) Copy() Bools
- func (s Bools) Diff(s2 Bools) Bools
- func (s Bools) Empty() bool
- func (s Bools) Equal(s2 Bools) bool
- func (s Bools) First() (bool, bool)
- func (s Bools) Get(i int) (bool, bool)
- func (s Bools) Intersect(s2 Bools) Bools
- func (s Bools) Last() (bool, bool)
- func (s Bools) Len() int
- func (s *Bools) Reset()
- func (s Bools) S() (out []any)
- func (s Bools) Take(n int) (out Bools)
- type Bytes
- func (s *Bytes) Add(values ...byte)
- func (s Bytes) Contains(values ...byte) bool
- func (s Bytes) ContainsOneOf(values ...byte) bool
- func (s Bytes) Copy() Bytes
- func (s Bytes) Diff(s2 Bytes) Bytes
- func (s Bytes) Empty() bool
- func (s Bytes) Equal(s2 Bytes) bool
- func (s Bytes) Find(matcher func(v byte) bool) (byte, bool)
- func (s Bytes) FindAll(matcher func(v byte) bool) Bytes
- func (s Bytes) First() (byte, bool)
- func (s Bytes) Get(i int) (byte, bool)
- func (s Bytes) Intersect(s2 Bytes) Bytes
- func (s Bytes) Last() (byte, bool)
- func (s Bytes) Len() int
- func (s *Bytes) Reset()
- func (s Bytes) S() (out []any)
- func (s Bytes) Take(n int) (out Bytes)
- type Date
- type DateTime
- type DateYearMonth
- type Floats
- func (s *Floats) Add(values ...float64)
- func (s Floats) Contains(values ...float64) bool
- func (s Floats) ContainsOneOf(values ...float64) bool
- func (s Floats) Copy() Floats
- func (s Floats) Diff(s2 Floats) Floats
- func (s Floats) Empty() bool
- func (s Floats) Equal(s2 Floats) bool
- func (s Floats) Find(matcher func(v float64) bool) (float64, bool)
- func (s Floats) FindAll(matcher func(v float64) bool) Floats
- func (s Floats) First() (float64, bool)
- func (s Floats) Get(i int) (float64, bool)
- func (s Floats) Intersect(s2 Floats) Floats
- func (s Floats) Last() (float64, bool)
- func (s Floats) Len() int
- func (s Floats) LenIf(f func(v float64) bool) (n int)
- func (s Floats) Mean() (mean float64)
- func (s Floats) MeanIf(f func(v float64) bool) (mean float64)
- func (s *Floats) Reset()
- func (s Floats) S() (out []any)
- func (s Floats) Sum() (sum float64)
- func (s Floats) SumIf(f func(v float64) bool) (sum float64)
- func (s Floats) Take(n int) (out Floats)
- type Int64s
- func (s *Int64s) Add(values ...int64)
- func (s Int64s) Contains(values ...int64) bool
- func (s Int64s) ContainsOneOf(values ...int64) bool
- func (s Int64s) Copy() Int64s
- func (s Int64s) Diff(s2 Int64s) Int64s
- func (s Int64s) Empty() bool
- func (s Int64s) Equal(s2 Int64s) bool
- func (s Int64s) Find(matcher func(v int64) bool) (int64, bool)
- func (s Int64s) FindAll(matcher func(v int64) bool) Int64s
- func (s Int64s) First() (int64, bool)
- func (s Int64s) Get(i int) (int64, bool)
- func (s Int64s) Intersect(s2 Int64s) Int64s
- func (s Int64s) Last() (int64, bool)
- func (s Int64s) Len() int
- func (s Int64s) LenIf(f func(v int64) bool) (n int)
- func (s Int64s) Mean() (mean float64)
- func (s Int64s) MeanIf(f func(v int64) bool) (mean float64)
- func (s *Int64s) Reset()
- func (s Int64s) S() (out []any)
- func (s Int64s) Sum() (sum int64)
- func (s Int64s) SumIf(f func(v int64) bool) (sum int64)
- func (s Int64s) Take(n int) (out Int64s)
- type Ints
- func (s *Ints) Add(values ...int)
- func (s Ints) Contains(values ...int) bool
- func (s Ints) ContainsOneOf(values ...int) bool
- func (s Ints) Copy() Ints
- func (s Ints) Diff(s2 Ints) Ints
- func (s Ints) Empty() bool
- func (s Ints) Equal(s2 Ints) bool
- func (s Ints) Find(matcher func(v int) bool) (int, bool)
- func (s Ints) FindAll(matcher func(v int) bool) Ints
- func (s Ints) First() (int, bool)
- func (s Ints) Get(i int) (int, bool)
- func (s Ints) Intersect(s2 Ints) Ints
- func (s Ints) Last() (int, bool)
- func (s Ints) Len() int
- func (s Ints) LenIf(f func(v int) bool) (n int)
- func (s Ints) Mean() (mean float64)
- func (s Ints) MeanIf(f func(v int) bool) (mean float64)
- func (s *Ints) Reset()
- func (s Ints) S() (out []any)
- func (s Ints) Sum() (sum int)
- func (s Ints) SumIf(f func(v int) bool) (sum int)
- func (s Ints) Take(n int) (out Ints)
- type Map
- func (m Map) Add(k string, v any)
- func (m Map) Copy() Map
- func (m Map) Find(matcher Matcher) (string, any, bool)
- func (m Map) FindAll(matcher Matcher) Map
- func (m Map) Get(k string) (v any, ok bool)
- func (m Map) Int(k string) int
- func (m Map) Int64(k string) int64
- func (m Map) Int64Ptr(k string) *int64
- func (m Map) IntPtr(k string) *int
- func (m Map) KeyExists(keys ...string) bool
- func (m Map) Keys() []string
- func (m Map) Len() int
- func (m Map) Merge(sub map[string]any)
- func (m *Map) Reset()
- func (m Map) Set(k string, v any)
- func (m Map) String(k string) string
- func (m Map) StringPtr(k string) *string
- func (m Map) Time(k string) time.Time
- func (m Map) TimePtr(k string) *time.Time
- func (m Map) Uint64(k string) uint64
- func (m Map) Uint64Ptr(k string) *uint64
- func (m Map) Values() []any
- type Matcher
- type Point
- type Points
- type Polyline
- type Slice
- func (s *Slice) Add(values ...any)
- func (s Slice) Contains(values ...any) bool
- func (s Slice) ContainsOneOf(values ...any) bool
- func (s Slice) Copy() Slice
- func (s Slice) Diff(s2 Slice) Slice
- func (s Slice) Empty() bool
- func (s Slice) Equal(s2 Slice) bool
- func (s Slice) Find(matcher func(v any) bool) (any, bool)
- func (s Slice) FindAll(matcher func(v any) bool) Slice
- func (s Slice) First() (any, bool)
- func (s Slice) Get(i int) (any, bool)
- func (s Slice) Intersect(s2 Slice) Slice
- func (s Slice) Last() (any, bool)
- func (s Slice) Len() int
- func (s *Slice) Reset()
- func (s Slice) S() (out []any)
- func (s Slice) Take(n int) (out Slice)
- type Strings
- func (s *Strings) Add(values ...string)
- func (s Strings) Contains(values ...string) bool
- func (s Strings) ContainsOneOf(values ...string) bool
- func (s Strings) Copy() Strings
- func (s Strings) Diff(s2 Strings) Strings
- func (s Strings) Empty() bool
- func (s Strings) Equal(s2 Strings) bool
- func (s Strings) Find(matcher func(v string) bool) (string, bool)
- func (s Strings) FindAll(matcher func(v string) bool) Strings
- func (s Strings) First() (string, bool)
- func (s Strings) Get(i int) (string, bool)
- func (s Strings) Intersect(s2 Strings) Strings
- func (s Strings) Last() (string, bool)
- func (s Strings) Len() int
- func (s *Strings) Reset()
- func (s Strings) S() (out []any)
- func (s Strings) Take(n int) (out Strings)
- type TSafeInt64s
- type TSafeInts
- type TSafeMap
- type TSafeStrings
- type TSafeUint64s
- type TSafeUints
- type Uint64s
- func (s *Uint64s) Add(values ...uint64)
- func (s Uint64s) Contains(values ...uint64) bool
- func (s Uint64s) ContainsOneOf(values ...uint64) bool
- func (s Uint64s) Copy() Uint64s
- func (s Uint64s) Diff(s2 Uint64s) Uint64s
- func (s Uint64s) Empty() bool
- func (s Uint64s) Equal(s2 Uint64s) bool
- func (s Uint64s) Excludes(s2 Uint64s) Uint64s
- func (s Uint64s) Filter(matcher func(v uint64) bool) Uint64s
- func (s Uint64s) Find(matcher func(v uint64) bool) (uint64, bool)
- func (s Uint64s) FindAll(matcher func(v uint64) bool) Uint64s
- func (s Uint64s) First() (uint64, bool)
- func (s Uint64s) Get(i int) (uint64, bool)
- func (s Uint64s) Intersect(s2 Uint64s) Uint64s
- func (s Uint64s) Last() (uint64, bool)
- func (s Uint64s) Len() int
- func (s Uint64s) LenIf(f func(v uint64) bool) (n int)
- func (s Uint64s) Mean() (mean float64)
- func (s Uint64s) MeanIf(f func(v uint64) bool) (mean float64)
- func (s *Uint64s) Reset()
- func (s Uint64s) S() (out []any)
- func (s Uint64s) Sum() (sum uint64)
- func (s Uint64s) SumIf(f func(v uint64) bool) (sum uint64)
- func (s Uint64s) Take(n int) (out Uint64s)
- type Uints
- func (s *Uints) Add(values ...uint)
- func (s Uints) Contains(values ...uint) bool
- func (s Uints) ContainsOneOf(values ...uint) bool
- func (s Uints) Copy() Uints
- func (s Uints) Diff(s2 Uints) Uints
- func (s Uints) Empty() bool
- func (s Uints) Equal(s2 Uints) bool
- func (s Uints) Find(matcher func(v uint) bool) (uint, bool)
- func (s Uints) FindAll(matcher func(v uint) bool) Uints
- func (s Uints) First() (uint, bool)
- func (s Uints) Get(i int) (uint, bool)
- func (s Uints) Intersect(s2 Uints) Uints
- func (s Uints) Last() (uint, bool)
- func (s Uints) Len() int
- func (s Uints) Mean() (mean float64)
- func (s *Uints) Reset()
- func (s Uints) S() (out []any)
- func (s Uints) Sum() (sum uint)
- func (s Uints) Take(n int) (out Uints)
- func (s Uints) Uint64s() (out Uint64s)
Constants ¶
const ( DateYearMonthFormat = "2006-01" DateFormat = "2006-01-02" DateTimeFormat = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func Float64NoZero ¶
Float64NoZero is a filter for LenIf, SumIf, MeanIf.
func UInt64NoZero ¶
UInt64NoZero is a filter for LenIf, SumIf, MeanIf.
Types ¶
type Bools ¶
type Bools []bool
Bools is a slice of bool.
func (Bools) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Bytes ¶
type Bytes []byte
Bytes is a slice of byte.
func (Bytes) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Date ¶
Date is a wrapper around time.Time.
func (Date) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Date) UnmarshalJSON ¶ added in v0.0.5
type DateTime ¶
DateTime is a wrapper around time.Time.
func NewDateTime ¶
NewDateTime create a new DateTime from a time.Time.
func ParseDateTime ¶
ParseDateTime returns the DateTime of the given string.
func (DateTime) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
type DateYearMonth ¶
DateYearMonth is a wrapper around time.Time.
func NewDateYearMonth ¶
func NewDateYearMonth(t time.Time) DateYearMonth
NewDateYearMonth returns a new date from a time.Time.
func ParseDateYearMonth ¶
func ParseDateYearMonth(t string) DateYearMonth
ParseDateYearMonth returns the DateYearMonth of the given string.
func (DateYearMonth) MarshalJSON ¶
func (d DateYearMonth) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (DateYearMonth) String ¶
func (d DateYearMonth) String() string
String returns the string representation of the date.
type Floats ¶
type Floats []float64
Floats is a slice of float64.
func (Floats) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Int64s ¶
type Int64s []int64
Int64s is a slice of int64.
func (Int64s) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Ints ¶
type Ints []int
Ints is a slice of int.
func (Ints) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Map ¶
Map is a hashmap.
type Slice ¶
type Slice []any
Slice is a slice of any.
func (Slice) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Strings ¶
type Strings []string
Strings is a slice of string.
func (Strings) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type TSafeInt64s ¶
type TSafeInt64s interface { // Reset the slice. Reset() // Contains say if "s" contains "values". Contains(...int64) bool // ContainsOneOf says if "s" contains one of the "values". ContainsOneOf(...int64) bool // Copy create a new copy of the slice. Copy() TSafeInt64s // Diff returns the difference between "s" and "s2". Diff(Int64s) Int64s // Empty says if the slice is empty. Empty() bool // Equal says if "s" and "s2" are equal. Equal(Int64s) bool // Find the first element matching the pattern. Find(func(v int64) bool) (int64, bool) // FindAll elements matching the pattern. FindAll(func(v int64) bool) Int64s // First return the value of the first element. First() (int64, bool) // Get the element "i" and say if it has been found. Get(int) (int64, bool) // Intersect return the intersection between "s" and "s2". Intersect(Int64s) Int64s // Last return the value of the last element. Last() (int64, bool) // Len returns the size of the slice. Len() int // Take n element and return a new slice. Take(int) Int64s // S convert s into []any S() []any // S convert s into Int64s Int64s() Int64s }
func SyncInt64s ¶
func SyncInt64s() TSafeInt64s
type TSafeInts ¶
type TSafeInts interface { // Reset the slice. Reset() // Contains say if "s" contains "values". Contains(...int) bool // ContainsOneOf says if "s" contains one of the "values". ContainsOneOf(...int) bool // Copy create a new copy of the slice. Copy() TSafeInts // Diff returns the difference between "s" and "s2". Diff(Ints) Ints // Empty says if the slice is empty. Empty() bool // Equal says if "s" and "s2" are equal. Equal(Ints) bool // Find the first element matching the pattern. Find(func(v int) bool) (int, bool) // FindAll elements matching the pattern. FindAll(func(v int) bool) Ints // First return the value of the first element. First() (int, bool) // Get the element "i" and say if it has been found. Get(int) (int, bool) // Intersect return the intersection between "s" and "s2". Intersect(Ints) Ints // Last return the value of the last element. Last() (int, bool) // Len returns the size of the slice. Len() int // Take n element and return a new slice. Take(int) Ints // S convert s into []any S() []any // Ints convert s into Ints Ints() Ints }
type TSafeMap ¶
type TSafeMap interface { // Add a new entry if the given key is not filled. Add(string, any) // Find the first element matching the pattern. Find(Matcher) (string, any, bool) // FindAll elements matching the pattern. FindAll(Matcher) Map // Get an element from the key. Get(string) (any, bool) // Map convert TSafeMap to Map. Map() Map // Set a new entry or change an entry for the given key "k". Set(string, any) // Reset the values. Reset() }
TSafeMap abstract the implementation of SyncMap.
type TSafeStrings ¶
type TSafeStrings interface { // Reset the slice. Reset() // Contains say if "s" contains "values". Contains(...string) bool // ContainsOneOf says if "s" contains one of the "values". ContainsOneOf(...string) bool // Copy create a new copy of the slice. Copy() TSafeStrings // Diff returns the difference between "s" and "s2". Diff(Strings) Strings // Empty says if the slice is empty. Empty() bool // Equal says if "s" and "s2" are equal. Equal(Strings) bool // Find the first element matching the pattern. Find(func(v string) bool) (string, bool) // FindAll elements matching the pattern. FindAll(func(v string) bool) Strings // First return the value of the first element. First() (string, bool) // Get the element "i" and say if it has been found. Get(int) (string, bool) // Intersect return the intersection between "s" and "s2". Intersect(Strings) Strings // Last return the value of the last element. Last() (string, bool) // Len returns the size of the slice. Len() int // Take n element and return a new slice. Take(int) Strings // S convert s into []any S() []any // S convert s into Strings Strings() Strings }
func SyncStrings ¶
func SyncStrings() TSafeStrings
type TSafeUint64s ¶
type TSafeUint64s interface { // Reset the slice. Reset() // Contains say if "s" contains "values". Contains(...uint64) bool // ContainsOneOf says if "s" contains one of the "values". ContainsOneOf(...uint64) bool // Copy create a new copy of the slice. Copy() TSafeUint64s // Diff returns the difference between "s" and "s2". Diff(Uint64s) Uint64s // Empty says if the slice is empty. Empty() bool // Equal says if "s" and "s2" are equal. Equal(Uint64s) bool // Find the first element matching the pattern. Find(func(v uint64) bool) (uint64, bool) // FindAll elements matching the pattern. FindAll(func(v uint64) bool) Uint64s // First return the value of the first element. First() (uint64, bool) // Get the element "i" and say if it has been found. Get(int) (uint64, bool) // Intersect return the intersection between "s" and "s2". Intersect(Uint64s) Uint64s // Last return the value of the last element. Last() (uint64, bool) // Len returns the size of the slice. Len() int // Take n element and return a new slice. Take(int) Uint64s // S convert s into []any S() []any // S convert s into Uint64s Uint64s() Uint64s }
func SyncUint64s ¶
func SyncUint64s() TSafeUint64s
type TSafeUints ¶
type TSafeUints interface { // Reset the slice. Reset() // Contains say if "s" contains "values". Contains(...uint) bool // ContainsOneOf says if "s" contains one of the "values". ContainsOneOf(...uint) bool // Copy create a new copy of the slice. Copy() TSafeUints // Diff returns the difference between "s" and "s2". Diff(Uints) Uints // Empty says if the slice is empty. Empty() bool // Equal says if "s" and "s2" are equal. Equal(Uints) bool // Find the first element matching the pattern. Find(func(v uint) bool) (uint, bool) // FindAll elements matching the pattern. FindAll(func(v uint) bool) Uints // First return the value of the first element. First() (uint, bool) // Get the element "i" and say if it has been found. Get(int) (uint, bool) // Intersect return the intersection between "s" and "s2". Intersect(Uints) Uints // Last return the value of the last element. Last() (uint, bool) // Len returns the size of the slice. Len() int // Take n element and return a new slice. Take(int) Uints // S convert s into []any S() []any // S convert s into Uints Uints() Uints }
func SyncUints ¶
func SyncUints() TSafeUints
type Uint64s ¶
type Uint64s []uint64
Uint64s is a slice of uint64.
func (Uint64s) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".
type Uints ¶
type Uints []uint
Uints is a slice of uint.
func (Uints) ContainsOneOf ¶
ContainsOneOf says if "s" contains one of the "values".