utils

package
v0.0.0-...-0132329 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntegerToString

func IntegerToString[T constraints.Integer](value T) string

IntegerToString converts the given integer to a string

func StringToInteger

func StringToInteger[T constraints.Integer](value string) (T, error)

StringToInteger converts a string to an integer of the given type

Types

type MultipleError

type MultipleError struct {
	// contains filtered or unexported fields
}

MultipleError represents an error containing multiple other errors

func NewMultipleError

func NewMultipleError() *MultipleError

NewMultipleError creates a new multiple error

func (*MultipleError) AppendError

func (me *MultipleError) AppendError(err error)

AppendError adds the given error

func (*MultipleError) Error

func (me *MultipleError) Error() string

Error returns a description of all the errors inside this MultipleError

func (*MultipleError) Errors

func (me *MultipleError) Errors() iter.Seq[error]

Errors returns a sequence of errors

func (*MultipleError) HasError

func (me *MultipleError) HasError(err error) bool

HasError checks if the given error is in this list

func (*MultipleError) Size

func (me *MultipleError) Size() int

Size returns the number of errors in this list

type Validater

type Validater interface {
	// Validate returns the validation error or nil if there is none
	Validate() error
}

Validater is an interface that represents a validatable type

Jump to

Keyboard shortcuts

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