package types
import "go4.org/types"
Package types provides various common types.
Index ¶
Variables ¶
EmptyBody is a ReadCloser that returns EOF on Read and does nothing on Close.
NopCloser is an io.Closer that does nothing.
Functions ¶
func NewOnceCloser ¶
NewOnceCloser returns a Closer wrapping c which only calls Close on c once. Subsequent calls to Close return nil.
Types ¶
type ByTime ¶
ByTime sorts times.
func (ByTime) Len ¶
func (ByTime) Less ¶
func (ByTime) Swap ¶
type CloseFunc ¶
type CloseFunc func() error
CloseFunc implements io.Closer with a function.
func (CloseFunc) Close ¶
type Time3339 ¶
Time3339 is a time.Time which encodes to and from JSON as an RFC 3339 time in UTC.
func ParseTime3339OrNil ¶
func ParseTime3339OrZero ¶
ParseTime3339OrZero parses a string in RFC3339 format. If it's invalid, the zero time value is returned instead.
func (*Time3339) IsAnyZero ¶
IsAnyZero returns whether the time is Go zero or Unix zero.
func (Time3339) MarshalJSON ¶
func (Time3339) String ¶
func (Time3339) Time ¶
Time returns the time as a time.Time with slightly less stutter than a manual conversion.
func (*Time3339) UnmarshalJSON ¶
Source Files ¶
types.go
- Version
- v0.0.0-20230225012048-214862532bf5 (latest)
- Published
- Feb 25, 2023
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 months ago –
Tools for package owners.