value

package
v0.0.0-...-21acb39 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HigherThanError

type HigherThanError[N constraints.Integer | constraints.Float] struct {
	// contains filtered or unexported fields
}

func ValueHigherThan

func ValueHigherThan[N constraints.Integer | constraints.Float](value N, limit N) HigherThanError[N]

func (HigherThanError[N]) Limit

func (err HigherThanError[N]) Limit() N

func (HigherThanError) Value

func (err HigherThanError) Value() any

type LowerThanError

type LowerThanError[N constraints.Integer | constraints.Float] struct {
	// contains filtered or unexported fields
}

func ValueLowerThan

func ValueLowerThan[N constraints.Integer | constraints.Float](value N, limit N) LowerThanError[N]

func (LowerThanError[N]) Limit

func (err LowerThanError[N]) Limit() N

func (LowerThanError) Value

func (err LowerThanError) Value() any

type MaxReachedError

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

func MaxReached

func MaxReached(max uint64, value any) MaxReachedError

func (MaxReachedError) Max

func (err MaxReachedError) Max() uint64

func (MaxReachedError) Value

func (err MaxReachedError) Value() any

type MinNotReachedError

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

func MinNotReached

func MinNotReached(min uint64, value any) MinNotReachedError

func (MinNotReachedError) Min

func (err MinNotReachedError) Min() uint64

func (MinNotReachedError) Value

func (err MinNotReachedError) Value() any

type Option

type Option[T any] interface {
	// contains filtered or unexported methods
}

func HigherThan

func HigherThan[N constraints.Integer | constraints.Float](Limit N) Option[N]

func LowerThan

func LowerThan[N constraints.Integer | constraints.Float](Limit N) Option[N]

func Max

func Max[T any](len uint64) Option[[]T]

func MaxChar

func MaxChar(len uint64) Option[string]

func Min

func Min[T any](Min uint64) Option[[]T]

func MinChars

func MinChars(Min uint64) Option[string]

type Value

type Value[T any] struct {
	// contains filtered or unexported fields
}

func Array

func Array[T any](options ...Option[[]T]) *Value[[]T]

func MaybeString

func MaybeString(options ...Option[string]) *Value[*string]

func Number

func Number[N constraints.Integer | constraints.Float](options ...Option[N]) *Value[N]

func String

func String(options ...Option[string]) *Value[string]

func (*Value[T]) String

func (value *Value[T]) String() string

func (*Value[T]) Validate

func (value *Value[T]) Validate(v T) Result[T]

Jump to

Keyboard shortcuts

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