Documentation ¶
Index ¶
- Constants
- func Debug(v string) bool
- func Filter[T any](s []T, fn func(T) bool) []T
- func Guard(err *error)
- func Keys[T comparable, U any](m map[T]U) []T
- func Log(v ...interface{})
- func Logf(format string, v ...interface{})
- func Map[T any, U any](s []T, fn func(T) U) []U
- func Must[T any](v T, err error) T
- func Must0(err error)
- func Must2[T1 any, T2 any](v1 T1, v2 T2, err error) (T1, T2)
- func Must3[T1 any, T2 any, T3 any](v1 T1, v2 T2, v3 T3, err error) (T1, T2, T3)
- func Must4[T1 any, T2 any, T3 any, T4 any](v1 T1, v2 T2, v3 T3, v4 T4, err error) (T1, T2, T3, T4)
- func Must5[T1 any, T2 any, T3 any, T4 any, T5 any](v1 T1, v2 T2, v3 T3, v4 T4, v5 T5, err error) (T1, T2, T3, T4, T5)
- func Must6[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any](v1 T1, v2 T2, v3 T3, v4 T4, v5 T5, v6 T6, err error) (T1, T2, T3, T4, T5, T6)
- func Must7[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any, T7 any](v1 T1, v2 T2, v3 T3, v4 T4, v5 T5, v6 T6, v7 T7, err error) (T1, T2, T3, T4, T5, T6, T7)
- func MustContext(ctx context.Context)
- func Ptr[T any](v T) *T
- func Repeat[T any](n int, v T) []T
- func Set[T comparable](s []T) map[T]struct{}
- func Suppress(err *error, fns ...F11[error, bool]) error
- func Values[T comparable, U any](m map[T]U) []U
- type D00
- type D01
- type D02
- type D03
- type D04
- type D10
- type D11
- type D12
- type D13
- type D14
- type D20
- type D21
- type D22
- type D23
- type D24
- type D30
- type D31
- type D32
- type D33
- type D34
- type D40
- type D41
- type D42
- type D43
- type D44
- type DebugSet
- type ErrorGroup
- type Errors
- type F00
- type F01
- type F02
- type F03
- type F04
- type F10
- type F11
- type F12
- type F13
- type F14
- type F20
- type F21
- type F22
- type F23
- type F24
- type F30
- type F31
- type F32
- type F33
- type F34
- type F40
- type F41
- type F42
- type F43
- type F44
- type Logger
- type M
- type T2
- type T3
- type T4
Constants ¶
const ( DebugWildcard = "*" DebugSeparator = ":" )
Variables ¶
This section is empty.
Functions ¶
func Must5 ¶
func Must5[T1 any, T2 any, T3 any, T4 any, T5 any](v1 T1, v2 T2, v3 T3, v4 T4, v5 T5, err error) (T1, T2, T3, T4, T5)
Must5 panic err if not nil, else return remaining values
func Must6 ¶
func Must6[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any](v1 T1, v2 T2, v3 T3, v4 T4, v5 T5, v6 T6, err error) (T1, T2, T3, T4, T5, T6)
Must6 panic err if not nil, else return remaining values
func Must7 ¶
func Must7[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any, T7 any](v1 T1, v2 T2, v3 T3, v4 T4, v5 T5, v6 T6, v7 T7, err error) (T1, T2, T3, T4, T5, T6, T7)
Must7 panic err if not nil, else return remaining values
func Set ¶
func Set[T comparable](s []T) map[T]struct{}
Set convert a slice of comparables into a Set-like map
Types ¶
type D00 ¶
type D00 interface {
Do()
}
D00 interface with a single method 0 with arguments and 0 returns
type D01 ¶
type D01[O1 any] interface { Do() (o1 O1) }
D01 interface with a single method 0 with arguments and 1 returns
type D10 ¶
type D10[I1 any] interface { Do(i1 I1) }
D10 interface with a single method 1 with arguments and 0 returns
type D14 ¶
type D14[I1 any, O1 any, O2 any, O3 any, O4 any] interface { Do(i1 I1) (o1 O1, o2 O2, o3 O3, o4 O4) }
D14 interface with a single method 1 with arguments and 4 returns
type D23 ¶
type D23[I1 any, I2 any, O1 any, O2 any, O3 any] interface { Do(i1 I1, i2 I2) (o1 O1, o2 O2, o3 O3) }
D23 interface with a single method 2 with arguments and 3 returns
type D24 ¶
type D24[I1 any, I2 any, O1 any, O2 any, O3 any, O4 any] interface { Do(i1 I1, i2 I2) (o1 O1, o2 O2, o3 O3, o4 O4) }
D24 interface with a single method 2 with arguments and 4 returns
type D32 ¶
type D32[I1 any, I2 any, I3 any, O1 any, O2 any] interface { Do(i1 I1, i2 I2, i3 I3) (o1 O1, o2 O2) }
D32 interface with a single method 3 with arguments and 2 returns
type D33 ¶
type D33[I1 any, I2 any, I3 any, O1 any, O2 any, O3 any] interface { Do(i1 I1, i2 I2, i3 I3) (o1 O1, o2 O2, o3 O3) }
D33 interface with a single method 3 with arguments and 3 returns
type D34 ¶
type D34[I1 any, I2 any, I3 any, O1 any, O2 any, O3 any, O4 any] interface { Do(i1 I1, i2 I2, i3 I3) (o1 O1, o2 O2, o3 O3, o4 O4) }
D34 interface with a single method 3 with arguments and 4 returns
type D41 ¶
type D41[I1 any, I2 any, I3 any, I4 any, O1 any] interface { Do(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1) }
D41 interface with a single method 4 with arguments and 1 returns
type D42 ¶
type D42[I1 any, I2 any, I3 any, I4 any, O1 any, O2 any] interface { Do(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1, o2 O2) }
D42 interface with a single method 4 with arguments and 2 returns
type D43 ¶
type D43[I1 any, I2 any, I3 any, I4 any, O1 any, O2 any, O3 any] interface { Do(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1, o2 O2, o3 O3) }
D43 interface with a single method 4 with arguments and 3 returns
type D44 ¶
type D44[I1 any, I2 any, I3 any, I4 any, O1 any, O2 any, O3 any, O4 any] interface { Do(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1, o2 O2, o3 O3, o4 O4) }
D44 interface with a single method 4 with arguments and 4 returns
type DebugSet ¶
func NewDebugSet ¶
NewDebugSet create a new DebugSet use comma ',' separate multiple items use '*' for wildcard, for example '*', 'echo:*,view:*'
type ErrorGroup ¶
func NewErrorGroup ¶
func NewErrorGroup() ErrorGroup
type F11 ¶
F11 function with 1 arguments and 1 returns
func Eq ¶
func Eq[T comparable](v T) F11[T, bool]
Eq returns a func that returns true if incoming value is same
func Neq ¶
func Neq[T comparable](v T) F11[T, bool]
Neq returns a func that returns true if incoming value is not same
type F24 ¶
type F24[I1 any, I2 any, O1 any, O2 any, O3 any, O4 any] func(i1 I1, i2 I2) (o1 O1, o2 O2, o3 O3, o4 O4)
F24 function with 2 arguments and 4 returns
type F33 ¶
type F33[I1 any, I2 any, I3 any, O1 any, O2 any, O3 any] func(i1 I1, i2 I2, i3 I3) (o1 O1, o2 O2, o3 O3)
F33 function with 3 arguments and 3 returns
type F34 ¶
type F34[I1 any, I2 any, I3 any, O1 any, O2 any, O3 any, O4 any] func(i1 I1, i2 I2, i3 I3) (o1 O1, o2 O2, o3 O3, o4 O4)
F34 function with 3 arguments and 4 returns
type F42 ¶
type F42[I1 any, I2 any, I3 any, I4 any, O1 any, O2 any] func(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1, o2 O2)
F42 function with 4 arguments and 2 returns
type F43 ¶
type F43[I1 any, I2 any, I3 any, I4 any, O1 any, O2 any, O3 any] func(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1, o2 O2, o3 O3)
F43 function with 4 arguments and 3 returns
type F44 ¶
type F44[I1 any, I2 any, I3 any, I4 any, O1 any, O2 any, O3 any, O4 any] func(i1 I1, i2 I2, i3 I3, i4 I4) (o1 O1, o2 O2, o3 O3, o4 O4)
F44 function with 4 arguments and 4 returns
type Logger ¶
type Logger interface { // Log inserts a log entry. Arguments may be handled in the manner // of fmt.Print, but the underlying logger may also decide to handle // them differently. Log(v ...interface{}) // Logf insets a log entry. Arguments are handled in the manner of // fmt.Printf. Logf(format string, v ...interface{}) }
Logger is a generic logging interface
var ( // DefaultLogger The global default logger DefaultLogger Logger = &stdLogger{} )