time

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = []string{
	"2006-01-02T15:04:05.999999999",
	"2006-01-02 15:04:05.999999999",
	"2006-01-02T15:04:05.999999999Z07:00",
	"2006-01-02 15:04:05.999999999Z07:00",
	"2006-01-02T15:04:05.999999999Z07",
	"2006-01-02 15:04:05.999999999Z07",
	"2006-01-02",
	"2006-01-02Z07:00",
	"2006-01-02Z07",
}

Default готовый набор форматов - просто для удобства.

Functions

func Eq

func Eq(value time.Time) validator.Action[time.Time]

func Ge

func Ge(value time.Time) validator.Action[time.Time]

func Gt

func Gt(value time.Time) validator.Action[time.Time]

func In

func In(values ...time.Time) validator.Action[time.Time]

func Le

func Le(value time.Time) validator.Action[time.Time]

func Lt

func Lt(value time.Time) validator.Action[time.Time]

func Ne

func Ne(value time.Time) validator.Action[time.Time]

func NotIn

func NotIn(values ...time.Time) validator.Action[time.Time]

func SetTimeZone

func SetTimeZone(tz *time.Location)

SetTimeZone устанавливает часовой пояс по умолчанию.

Types

type Build

type Build struct {
	validator.Rules[time.Time]
	// contains filtered or unexported fields
}

Build реализует построитель валидатора значения time.Time

func Time

func Time(formats []string, rules ...validator.Action[time.Time]) *Build

Time создаёт построитель валидатора time.Time. Получает массив допустимых форматов даты/времени и набор действий.

func (*Build) Append

func (b *Build) Append(rules ...validator.Action[time.Time]) *Build

Append добавляет действия в набор действий построителя

func (*Build) Validator

func (b *Build) Validator() validator.Validator

Validator создаёт валидатор time.Time

Jump to

Keyboard shortcuts

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