xsd

package module
v0.0.0-...-f0bcc40 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Day = time.Hour * 24
	// These values are not precise, probably why the time package does not implement them
	// We need them for because xsd:duration has them
	Month = Day * 30
	Year  = Day * 356
)

Extending time constants with the values for day, week, month, year

Variables

This section is empty.

Functions

func Days

func Days(d time.Duration) float64

func Marshal

func Marshal(d time.Duration) ([]byte, error)

func Months

func Months(d time.Duration) float64

func Unmarshal

func Unmarshal(data []byte, d *time.Duration) error

Unmarshal takes a byte array and unmarshals it to a time.Duration value It is used to parse values in the following format: -PuYuMuDTuHuMufS, where:

  • - shows if the duration is negative
  • P is the duration tag
  • T is the time tag separator
  • Y,M,D,H,M,S are tags for year, month, day, hour, minute, second values
  • u is an unsigned integer value
  • uf is an unsigned float value (just for seconds)

func Years

func Years(d time.Duration) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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