relec

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

README

relec

Go Utilities to be used in your project

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Absolute

func Absolute[T int | int8 | int16 | int32 | int64 | float32 | float64](value T) T

func ArrayContains

func ArrayContains[T ~string | int | int8 | int16 | int32 | int64 | float32 | float64](set []T, value T) bool

func CheckIfFilesExists

func CheckIfFilesExists(files ...string) error

func Concurrent

func Concurrent[T any](ctx context.Context, array []T, concurrency int, execute func(one T) error) error

func ConcurrentC added in v0.0.2

func ConcurrentC[T any](ctx context.Context, yield <-chan T, concurrency int, execute func(one T) error) error

func FindInArray

func FindInArray[T any](set []T, match func(elem T) bool) (int, bool)

func IsInstance

func IsInstance(val any, typ reflect.Kind) bool

func IsOfType

func IsOfType(object interface{}, decidingKey string) (bool, error)

func IsSubset

func IsSubset[T comparable](setArray, subsetArray []T) bool

func MaxDate

func MaxDate(v1, v2 time.Time) time.Time

func Unmarshal

func Unmarshal(from interface{}, object interface{}) error

Unmarshal serializes and deserializes any from into the object return error if occurred

func UnmarshalFile

func UnmarshalFile(file string, dest any) error

func Validate

func Validate[T any](structure T) error

func Yield added in v0.0.2

func Yield[T any](generate func(channel chan<- T)) <-chan T

Types

type Logger

type Logger interface {
	Info(v ...interface{})
	Infof(format string, v ...interface{})
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})
	Error(v ...interface{})
	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Warn(v ...interface{})
	Warnf(format string, v ...interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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