Documentation ¶
Overview ¶
Package types provides custom types to support CloudEvents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Timestamp ¶
Timestamp wraps time.Time to normalize the time layout to RFC3339. It is intended to enforce compliance with the CloudEvents spec for their definition of Timestamp. Custom marshal methods are implemented to ensure the outbound Timestamp is a string in the RFC3339 layout.
func ParseTimestamp ¶
ParseTimestamp attempts to parse the given time assuming RFC3339 layout
func (*Timestamp) MarshalJSON ¶
MarshalJSON implements a custom json marshal method used when this type is marshaled using json.Marshal.
func (*Timestamp) MarshalXML ¶
MarshalXML implements a custom xml marshal method used when this type is marshaled using xml.Marshal.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshal method used when this type is unmarshaled using json.Unmarshal.
func (*Timestamp) UnmarshalXML ¶
UnmarshalXML implements the xml unmarshal method used when this type is unmarshaled using xml.Unmarshal.
type URLRef ¶
URLRef is a wrapper to url.URL. It is intended to enforce compliance with the CloudEvents spec for their definition of URI-Reference. Custom marshal methods are implemented to ensure the outbound URLRef object is is a flat string.
func ParseURLRef ¶
ParseURLRef attempts to parse the given string as a URI-Reference.
func (URLRef) MarshalJSON ¶
MarshalJSON implements a custom json marshal method used when this type is marshaled using json.Marshal.
func (URLRef) MarshalXML ¶
MarshalXML implements a custom xml marshal method used when this type is marshaled using xml.Marshal.
func (*URLRef) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshal method used when this type is unmarshaled using json.Unmarshal.
func (*URLRef) UnmarshalXML ¶
UnmarshalXML implements the xml unmarshal method used when this type is unmarshaled using xml.Unmarshal.