helper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure[T any, O Option[T]](input T, opt ...O) T

func ConfigurePtr

func ConfigurePtr[T any, O Option[T]](input *T, opt ...O) *T

func ConfigurePtrWithError

func ConfigurePtrWithError[T any, O OptionError[T]](input *T, opt ...O) (*T, error)

func ConfigureWithError

func ConfigureWithError[T any, O OptionError[T]](input T, opt ...O) (T, error)

func Filter

func Filter[T any, A ~[]T](input A, filter func(elem T) bool) A

func Map

func Map[T any, A ~[]T, O any](input A, mapper func(elem T) O) []O

func SetLog

func SetLog(level slog.Level)

Types

type Option

type Option[T any] func(configure *T)

type OptionError

type OptionError[T any] func(configure *T) error

Jump to

Keyboard shortcuts

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