value

package module
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Nanosecond  = duration(time.Nanosecond)
	Microsecond = duration(time.Microsecond)
	Millisecond = duration(time.Millisecond)
	Second      = duration(time.Second)
	Minute      = duration(time.Minute)
	Hour        = duration(time.Hour)
	Day         = Hour * 24
	Week        = Day * 7
	Fortnight   = Week * 2
	Month       = Day * 30    // Approximation
	Year        = Day * 365   // Approximation
	Decade      = Year * 10   // Approximation
	Century     = Year * 100  // Approximation
	Millennium  = Year * 1000 // Approximation
)

Standard unit of time.

Functions

This section is empty.

Types

type ValueBaseTime added in v1.3.3

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

ValueBaseTime is a debefix.ValueCalculator calculate times based on a base time and a duration. In addition to time.Duration, 3 more suffixes are supported: d (days), w (weeks), y (years).

func NewValueBaseTime added in v1.3.3

func NewValueBaseTime(baseTime time.Time, options ...ValueTimeOption) *ValueBaseTime

func (ValueBaseTime) CalculateValue added in v1.3.3

func (v ValueBaseTime) CalculateValue(typ string, parameter string) (bool, any, error)

type ValueTimeOption added in v1.3.3

type ValueTimeOption func(*ValueBaseTime)

func WithValueTimeTypeName added in v1.3.3

func WithValueTimeTypeName(typeName string) ValueTimeOption

type ValueUUID added in v0.15.0

type ValueUUID struct{}

ValueUUID is a debefix.ValueParser to parse "!uuid" tags to uuid.UUID, a debefix.ResolvedValueParser to to parse "uuid" type to uuid.UUID, and debefix.ValueCalculator to generate new UUID values.

func (ValueUUID) CalculateValue added in v1.3.2

func (v ValueUUID) CalculateValue(typ string, parameter string) (bool, any, error)

func (ValueUUID) ParseResolvedValue added in v0.15.0

func (v ValueUUID) ParseResolvedValue(typ string, value any) (bool, any, error)

func (ValueUUID) ParseValue added in v0.15.0

func (v ValueUUID) ParseValue(tag *ast.TagNode) (bool, any, error)

Jump to

Keyboard shortcuts

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