sdtypes

package
v0.0.0-...-080ad10 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sdtypes is a package providing various helpers for serialized data types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpochTime

type EpochTime struct {
	time.Time
}

EpochTime represents a time.Time that is encoded and decoded as a Unix timestamp in seconds.

func (*EpochTime) MarshalJSON

func (e *EpochTime) MarshalJSON() ([]byte, error)

func (*EpochTime) MarshalXML

func (e *EpochTime) MarshalXML(elem *xml.Encoder, start xml.StartElement) error

func (*EpochTime) MarshalXMLAttr

func (e *EpochTime) MarshalXMLAttr(name xml.Name) xml.Attr

func (*EpochTime) UnmarshalJSON

func (e *EpochTime) UnmarshalJSON(data []byte) error

func (*EpochTime) UnmarshalXML

func (e *EpochTime) UnmarshalXML(elem *xml.Decoder, start xml.StartElement) error

func (*EpochTime) UnmarshalXMLAttr

func (e *EpochTime) UnmarshalXMLAttr(attr xml.Attr) error

type EpochTimeMillis

type EpochTimeMillis struct {
	time.Time
}

EpochTimeMillis represents a time.Time that is encoded and decoded as a Unix timestamp in milliseconds.

func (*EpochTimeMillis) MarshalJSON

func (e *EpochTimeMillis) MarshalJSON() ([]byte, error)

func (*EpochTimeMillis) MarshalXML

func (e *EpochTimeMillis) MarshalXML(elem *xml.Encoder, start xml.StartElement) error

func (*EpochTimeMillis) MarshalXMLAttr

func (e *EpochTimeMillis) MarshalXMLAttr(name xml.Name) xml.Attr

func (*EpochTimeMillis) UnmarshalJSON

func (e *EpochTimeMillis) UnmarshalJSON(data []byte) error

func (*EpochTimeMillis) UnmarshalXML

func (e *EpochTimeMillis) UnmarshalXML(elem *xml.Decoder, start xml.StartElement) error

func (*EpochTimeMillis) UnmarshalXMLAttr

func (e *EpochTimeMillis) UnmarshalXMLAttr(attr xml.Attr) error

type EpochTimeNanos

type EpochTimeNanos struct {
	time.Time
}

EpochTimeNanos represents a time.Time that is encoded and decoded as a Unix timestamp in nanoseconds.

func (*EpochTimeNanos) MarshalJSON

func (e *EpochTimeNanos) MarshalJSON() ([]byte, error)

func (*EpochTimeNanos) MarshalXML

func (e *EpochTimeNanos) MarshalXML(elem *xml.Encoder, start xml.StartElement) error

func (*EpochTimeNanos) MarshalXMLAttr

func (e *EpochTimeNanos) MarshalXMLAttr(name xml.Name) xml.Attr

func (*EpochTimeNanos) UnmarshalJSON

func (e *EpochTimeNanos) UnmarshalJSON(data []byte) error

func (*EpochTimeNanos) UnmarshalXML

func (e *EpochTimeNanos) UnmarshalXML(elem *xml.Decoder, start xml.StartElement) error

func (*EpochTimeNanos) UnmarshalXMLAttr

func (e *EpochTimeNanos) UnmarshalXMLAttr(attr xml.Attr) error

type EpochXCoder

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

func (*EpochXCoder) DecodeInt

func (x *EpochXCoder) DecodeInt(i int64) time.Time

func (*EpochXCoder) DecodeJSON

func (x *EpochXCoder) DecodeJSON(data []byte) (t time.Time, err error)

func (*EpochXCoder) DecodeString

func (x *EpochXCoder) DecodeString(s string) (t time.Time, err error)

func (EpochXCoder) DecodeXMLAttr

func (x EpochXCoder) DecodeXMLAttr(attr xml.Attr) (t time.Time, err error)

func (*EpochXCoder) DecodeXMLElement

func (x *EpochXCoder) DecodeXMLElement(elem *xml.Decoder, start xml.StartElement) (t time.Time, err error)

func (*EpochXCoder) EncodeInt

func (x *EpochXCoder) EncodeInt(t time.Time) int64

func (*EpochXCoder) EncodeJSON

func (x *EpochXCoder) EncodeJSON(t time.Time) ([]byte, error)

func (*EpochXCoder) EncodeString

func (x *EpochXCoder) EncodeString(t time.Time) string

func (*EpochXCoder) EncodeXML

func (x *EpochXCoder) EncodeXML(t time.Time, elem *xml.Encoder, start xml.StartElement) error

func (*EpochXCoder) EncodeXMLAttr

func (x *EpochXCoder) EncodeXMLAttr(t time.Time, name xml.Name) xml.Attr

type ISOTime

type ISOTime time.Time

func (ISOTime) MarshalJSON

func (t ISOTime) MarshalJSON() ([]byte, error)

func (ISOTime) Time

func (t ISOTime) Time() time.Time

func (*ISOTime) UnmarshalJSON

func (t *ISOTime) UnmarshalJSON(v []byte) error

type RFC3339Time

type RFC3339Time time.Time

func (RFC3339Time) MarshalJSON

func (t RFC3339Time) MarshalJSON() ([]byte, error)

func (RFC3339Time) Time

func (t RFC3339Time) Time() time.Time

func (*RFC3339Time) UnmarshalJSON

func (t *RFC3339Time) UnmarshalJSON(v []byte) error

Jump to

Keyboard shortcuts

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