util

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheWriteAlong

func CacheWriteAlong[T any](bufferSize uint64, dateLastFlushed time.Time, cache cache.Cache[T], entry T) bool

func DateDiffInMinutes

func DateDiffInMinutes(a time.Time, b time.Time) uint64

func GetDeclaredField

func GetDeclaredField(i interface{}, name string) (reflect.StructField, bool)

func GetDeclaredFieldValue

func GetDeclaredFieldValue(i interface{}, name string) (reflect.Value, bool)

func GetDeclaredFieldValueAs

func GetDeclaredFieldValueAs[T any](i interface{}, name string) T

func GetDeclaredFieldValueAsTime

func GetDeclaredFieldValueAsTime(i interface{}, name string) time.Time

func GetDeclaredFieldValueAsUint

func GetDeclaredFieldValueAsUint(i interface{}, name string) uint64

func GetDeclaredMethod

func GetDeclaredMethod(i interface{}, name string) (reflect.Method, bool)

func GetDeclaredMethodValue

func GetDeclaredMethodValue(i interface{}, name string) reflect.Value

func GetDeclaredSurefireField

func GetDeclaredSurefireField(i interface{}, name string) reflect.Value

func GetDeclaredSurefireFieldFromPtr

func GetDeclaredSurefireFieldFromPtr(i interface{}, name string) reflect.Value

func GetDeclaredSurefireMethod

func GetDeclaredSurefireMethod(i interface{}, name string) reflect.Value

func GetDeclaredSurefireMethodFromPtr

func GetDeclaredSurefireMethodFromPtr(i interface{}, name string) reflect.Value

func GetFieldNonPtrType

func GetFieldNonPtrType(i interface{}) reflect.Type

func GetFieldNonPtrValue

func GetFieldNonPtrValue(i interface{}) reflect.Value

func GetFieldPtrType

func GetFieldPtrType(i interface{}) reflect.Type

func GetFieldPtrValue

func GetFieldPtrValue(i interface{}) reflect.Value

func GetOrDefault

func GetOrDefault[T any](v T, d T) T

func GetPtrDeclaredMethod

func GetPtrDeclaredMethod(i interface{}, name string) (reflect.Method, bool)

func GetTypeName

func GetTypeName(i interface{}) string

func If

func If[T any](c bool, t T, f T) T

func InterfaceToString

func InterfaceToString(s interface{}) string

func InvokeSurefireMethod

func InvokeSurefireMethod(i interface{}, name string, params ...reflect.Value) []reflect.Value

func PatternToRegex

func PatternToRegex(p string) *regexp.Regexp

func PostRequestForResponse

func PostRequestForResponse[T any](url string, body []byte, headers map[string]string) (int, T)

func ReplaceByRegex

func ReplaceByRegex(s string, r string, v string) string

func RequestForResponse

func RequestForResponse[T any](method string, url string, body []byte, headers map[string]string) (int, T)

func SetFieldValue

func SetFieldValue(i interface{}, name string, value interface{})

func SlicesInterception

func SlicesInterception[T string | uint64](t1 []T, t2 []T) []T

func SlicesIntercepts

func SlicesIntercepts[T string | uint64](t1 []T, t2 []T) bool

func SplitByRegex

func SplitByRegex(str string, regex string) []string

func StackTrace

func StackTrace(skip int) []string

func StackTraceAsString

func StackTraceAsString(skip int) string

func StrFormat

func StrFormat(str string, args ...any) string

func StringToInterface

func StringToInterface(s string) interface{}

func StructDeclaredMethod

func StructDeclaredMethod(i interface{}, name string) bool

func StructImplementsDeclared

func StructImplementsDeclared(i interface{}, name string) bool

func ToSnakeCase

func ToSnakeCase(str string) string

func TranverseDeclaredMethods

func TranverseDeclaredMethods(i interface{}, fn func(reflect.Method, reflect.Value))

func TranverseIterable

func TranverseIterable(m interface{}, fn func(any, any))

func ValueInSlice

func ValueInSlice[T comparable](list []T, a T) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL