value

package
v0.0.0-...-6d82c9b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT, Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package value defines some `form.Value` implementations for common data types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date struct {
	Value   *time.Time
	Default time.Time
}

Date maps text to a structured date.

func (Date) Clear

func (v Date) Clear()

func (Date) From

func (v Date) From(text string) (err error)

func (Date) To

func (v Date) To() (string, error)

type Days

type Days struct {
	Value *time.Duration
}

Days maps text to 24 hour units of time.

func (Days) Clear

func (v Days) Clear()

func (Days) From

func (v Days) From(text string) (err error)

func (Days) To

func (v Days) To() (string, error)

type Float

type Float struct {
	Value *float64
}

Float maps text to a floating point number.

func (Float) Clear

func (v Float) Clear()

func (Float) From

func (v Float) From(text string) (err error)

func (Float) To

func (v Float) To() (string, error)

type Int

type Int struct {
	Value   *int
	Default int
}

Int maps text to an integer number.

func (Int) Clear

func (v Int) Clear()

func (Int) From

func (v Int) From(text string) (err error)

func (Int) To

func (v Int) To() (string, error)

type Required

type Required struct {
	form.Value
}

Required errors when the field is empty.

func (Required) From

func (v Required) From(text string) error

type Text

type Text struct {
	Value *string
}

Text wraps a text value.

func (Text) Clear

func (v Text) Clear()

func (Text) From

func (v Text) From(text string) error

func (Text) To

func (v Text) To() (string, error)

Jump to

Keyboard shortcuts

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