Documentation
¶
Index ¶
- func All[T any](slice []T, pass func(T, int) bool) bool
- func Compact[T comparable](slice []T) []T
- func DelFirst[T any](s *[]T) (T, bool)
- func DelLast[T any](s *[]T) (T, bool)
- func Filter[T any](slice []T, keep func(T, int) bool) []T
- func Find[T any](slice []T, pass func(T, int) bool) T
- func FindIndex[T any](slice []T, pass func(T) bool) int
- func ForEach[T any](slice []T, fn func(item T, index int))
- func ForEachAsync[T any](collection []T, fn func(item T, index int))
- func Map[T any, K any](slice []T, transform func(T, int) K) []K
- func MapAsync[T any, K any](collection []T, fn func(item T, index int) K) []K
- func Reverse[T any](slice []T) []T
- func Some[T any](slice []T, pass func(T, int) bool) bool
- type ClientConfig
- type DefaultMap
- type HttpClient
- func (hc *HttpClient) AddInterceptor(i Interceptor)
- func (hc *HttpClient) Request(method, uri string, headers map[string]string, body []byte) (*Response, error)
- func (hc *HttpClient) RequestWithContext(ctx context.Context, method, uri string, headers map[string]string, ...) (*Response, error)
- func (hc *HttpClient) SetBaseUrl(baseUrl string)
- type Interceptor
- type Response
- type SafeTreeMap
- func (s *SafeTreeMap) AsAny() (any, error)
- func (s *SafeTreeMap) AsAnyOr(def any) any
- func (s *SafeTreeMap) AsAnySlice() []any
- func (s *SafeTreeMap) AsBool() (bool, error)
- func (s *SafeTreeMap) AsBoolOr(def bool) bool
- func (s *SafeTreeMap) AsBoolSlice() []bool
- func (s *SafeTreeMap) AsFloat() (float64, error)
- func (s *SafeTreeMap) AsFloatOr(def float64) float64
- func (s *SafeTreeMap) AsInt() (int64, error)
- func (s *SafeTreeMap) AsIntOr(def int64) int64
- func (s *SafeTreeMap) AsIntSlice() []int64
- func (s *SafeTreeMap) AsMap() (DefaultMap, error)
- func (s *SafeTreeMap) AsSlice() ([]TreeMapImpl, error)
- func (s *SafeTreeMap) AsSliceOf(target []any) error
- func (s *SafeTreeMap) AsStrSlice() []string
- func (s *SafeTreeMap) AsString() (string, error)
- func (s *SafeTreeMap) AsStringOr(def string) string
- func (s *SafeTreeMap) AsStruct(target any) error
- func (s *SafeTreeMap) Clone() TreeMapImpl
- func (s *SafeTreeMap) Delete(path string) TreeMapImpl
- func (s *SafeTreeMap) Exists() bool
- func (s *SafeTreeMap) Get(path string) TreeMapImpl
- func (s *SafeTreeMap) IsDefined(path string) bool
- func (s *SafeTreeMap) IsEmpty() bool
- func (s *SafeTreeMap) Or(path string) TreeMapImpl
- func (s *SafeTreeMap) Set(path string, value any) TreeMapImpl
- func (s *SafeTreeMap) ToJsonString(pretty bool) string
- func (s *SafeTreeMap) TryDelete(path string) TreeMapImpl
- type TreeMap
- func (d *TreeMap) AsAny() (any, error)
- func (d *TreeMap) AsAnyOr(def any) any
- func (d *TreeMap) AsAnySlice() []any
- func (d *TreeMap) AsBool() (bool, error)
- func (d *TreeMap) AsBoolOr(def bool) bool
- func (d *TreeMap) AsBoolSlice() []bool
- func (d *TreeMap) AsFloat() (float64, error)
- func (d *TreeMap) AsFloatOr(def float64) float64
- func (d *TreeMap) AsInt() (int64, error)
- func (d *TreeMap) AsIntOr(def int64) int64
- func (d *TreeMap) AsIntSlice() []int64
- func (d *TreeMap) AsMap() (DefaultMap, error)
- func (d *TreeMap) AsSlice() ([]TreeMapImpl, error)
- func (d *TreeMap) AsSliceOf(target []any) error
- func (d *TreeMap) AsStrSlice() []string
- func (d *TreeMap) AsString() (string, error)
- func (d *TreeMap) AsStringOr(def string) string
- func (d *TreeMap) AsStruct(target any) error
- func (d *TreeMap) Clone() TreeMapImpl
- func (d *TreeMap) Delete(path string) TreeMapImpl
- func (d *TreeMap) Exists() bool
- func (d *TreeMap) Get(path string) TreeMapImpl
- func (d *TreeMap) IsDefined(path string) bool
- func (d *TreeMap) IsEmpty() bool
- func (d *TreeMap) Or(path string) TreeMapImpl
- func (d *TreeMap) Set(path string, value any) TreeMapImpl
- func (d *TreeMap) ToJsonString(pretty bool) string
- func (d *TreeMap) TryDelete(path string) TreeMapImpl
- type TreeMapImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachAsync ¶
All functions are called async
Types ¶
type ClientConfig ¶
type DefaultMap ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(cfg *ClientConfig) (*HttpClient, error)
func (*HttpClient) AddInterceptor ¶
func (hc *HttpClient) AddInterceptor(i Interceptor)
func (*HttpClient) RequestWithContext ¶ added in v1.5.0
func (*HttpClient) SetBaseUrl ¶ added in v1.0.1
func (hc *HttpClient) SetBaseUrl(baseUrl string)
type Interceptor ¶
type SafeTreeMap ¶ added in v1.5.0
type SafeTreeMap struct {
// contains filtered or unexported fields
}
func (*SafeTreeMap) AsAny ¶ added in v1.5.0
func (s *SafeTreeMap) AsAny() (any, error)
func (*SafeTreeMap) AsAnyOr ¶ added in v1.5.0
func (s *SafeTreeMap) AsAnyOr(def any) any
func (*SafeTreeMap) AsAnySlice ¶ added in v1.5.0
func (s *SafeTreeMap) AsAnySlice() []any
func (*SafeTreeMap) AsBool ¶ added in v1.5.0
func (s *SafeTreeMap) AsBool() (bool, error)
func (*SafeTreeMap) AsBoolOr ¶ added in v1.5.0
func (s *SafeTreeMap) AsBoolOr(def bool) bool
func (*SafeTreeMap) AsBoolSlice ¶ added in v1.5.0
func (s *SafeTreeMap) AsBoolSlice() []bool
func (*SafeTreeMap) AsFloat ¶ added in v1.5.0
func (s *SafeTreeMap) AsFloat() (float64, error)
func (*SafeTreeMap) AsFloatOr ¶ added in v1.5.0
func (s *SafeTreeMap) AsFloatOr(def float64) float64
func (*SafeTreeMap) AsInt ¶ added in v1.5.0
func (s *SafeTreeMap) AsInt() (int64, error)
func (*SafeTreeMap) AsIntOr ¶ added in v1.5.0
func (s *SafeTreeMap) AsIntOr(def int64) int64
func (*SafeTreeMap) AsIntSlice ¶ added in v1.5.0
func (s *SafeTreeMap) AsIntSlice() []int64
func (*SafeTreeMap) AsMap ¶ added in v1.5.0
func (s *SafeTreeMap) AsMap() (DefaultMap, error)
func (*SafeTreeMap) AsSlice ¶ added in v1.5.0
func (s *SafeTreeMap) AsSlice() ([]TreeMapImpl, error)
func (*SafeTreeMap) AsSliceOf ¶ added in v1.5.0
func (s *SafeTreeMap) AsSliceOf(target []any) error
------------------- Struct / Slice Conversions -------------------
func (*SafeTreeMap) AsStrSlice ¶ added in v1.5.0
func (s *SafeTreeMap) AsStrSlice() []string
------------------- Slice Helpers -------------------
func (*SafeTreeMap) AsString ¶ added in v1.5.0
func (s *SafeTreeMap) AsString() (string, error)
------------------- Value Conversions -------------------
func (*SafeTreeMap) AsStringOr ¶ added in v1.5.0
func (s *SafeTreeMap) AsStringOr(def string) string
------------------- Default Fallbacks -------------------
func (*SafeTreeMap) AsStruct ¶ added in v1.5.0
func (s *SafeTreeMap) AsStruct(target any) error
func (*SafeTreeMap) Clone ¶ added in v1.5.0
func (s *SafeTreeMap) Clone() TreeMapImpl
func (*SafeTreeMap) Delete ¶ added in v1.5.0
func (s *SafeTreeMap) Delete(path string) TreeMapImpl
func (*SafeTreeMap) Exists ¶ added in v1.5.2
func (s *SafeTreeMap) Exists() bool
func (*SafeTreeMap) Get ¶ added in v1.5.0
func (s *SafeTreeMap) Get(path string) TreeMapImpl
------------------- Core -------------------
func (*SafeTreeMap) IsDefined ¶ added in v1.5.1
func (s *SafeTreeMap) IsDefined(path string) bool
func (*SafeTreeMap) IsEmpty ¶ added in v1.5.2
func (s *SafeTreeMap) IsEmpty() bool
func (*SafeTreeMap) Or ¶ added in v1.5.1
func (s *SafeTreeMap) Or(path string) TreeMapImpl
func (*SafeTreeMap) Set ¶ added in v1.5.0
func (s *SafeTreeMap) Set(path string, value any) TreeMapImpl
func (*SafeTreeMap) ToJsonString ¶ added in v1.5.0
func (s *SafeTreeMap) ToJsonString(pretty bool) string
func (*SafeTreeMap) TryDelete ¶ added in v1.5.0
func (s *SafeTreeMap) TryDelete(path string) TreeMapImpl
type TreeMap ¶
type TreeMap struct {
// contains filtered or unexported fields
}
func (*TreeMap) AsAnySlice ¶ added in v1.5.0
func (*TreeMap) AsBoolSlice ¶ added in v1.5.0
func (*TreeMap) AsIntSlice ¶ added in v1.5.0
func (*TreeMap) AsMap ¶
func (d *TreeMap) AsMap() (DefaultMap, error)
func (*TreeMap) AsSlice ¶
func (d *TreeMap) AsSlice() ([]TreeMapImpl, error)
func (*TreeMap) AsStrSlice ¶ added in v1.5.0
------------------- AsStrSlice / AsIntSlice / etc -------------------
func (*TreeMap) AsStringOr ¶ added in v1.3.0
------------------- Default Fallbacks -------------------
func (*TreeMap) Clone ¶ added in v1.5.0
func (d *TreeMap) Clone() TreeMapImpl
func (*TreeMap) Delete ¶
func (d *TreeMap) Delete(path string) TreeMapImpl
delete path key and returns a new treemap with from path value
func (*TreeMap) Get ¶
func (d *TreeMap) Get(path string) TreeMapImpl
------------------- Get -------------------
func (*TreeMap) Or ¶ added in v1.3.0
func (d *TreeMap) Or(path string) TreeMapImpl
func (*TreeMap) Set ¶
func (d *TreeMap) Set(path string, value any) TreeMapImpl
------------------- Set -------------------
func (*TreeMap) ToJsonString ¶
func (*TreeMap) TryDelete ¶ added in v1.4.0
func (d *TreeMap) TryDelete(path string) TreeMapImpl
delete path key and returns the root treemap
type TreeMapImpl ¶ added in v1.5.1
type TreeMapImpl interface {
Get(path string) TreeMapImpl
IsDefined(path string) bool
Exists() bool
IsEmpty() bool
Or(path string) TreeMapImpl
Set(path string, value any) TreeMapImpl
Delete(path string) TreeMapImpl
TryDelete(path string) TreeMapImpl
Clone() TreeMapImpl
ToJsonString(pretty bool) string
AsMap() (DefaultMap, error)
AsSlice() ([]TreeMapImpl, error)
AsString() (string, error)
AsInt() (int64, error)
AsFloat() (float64, error)
AsBool() (bool, error)
AsAny() (any, error)
AsSliceOf(target []any) error
AsStruct(target any) error
AsStringOr(def string) string
AsIntOr(def int64) int64
AsFloatOr(def float64) float64
AsBoolOr(def bool) bool
AsAnyOr(def any) any
AsStrSlice() []string
AsIntSlice() []int64
AsBoolSlice() []bool
AsAnySlice() []any
// contains filtered or unexported methods
}
func NewSyncTreeMap ¶ added in v1.5.0
func NewSyncTreeMap(data ...any) TreeMapImpl
func NewTreeMap ¶
func NewTreeMap(data ...any) TreeMapImpl
------------------- Constructors -------------------