serialization

package
v2.19.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpochTime

type EpochTime time.Time

EpochTime is a type used for unmarshaling timestamps represented in epoch time. Its underlying type is time.Time.

func (EpochTime) Equal

func (e EpochTime) Equal(u EpochTime) bool

Equal provides a comparator for the EpochTime type.

func (EpochTime) MarshalJSON

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

MarshalJSON is responsible for marshaling the EpochTime type.

func (EpochTime) String

func (e EpochTime) String() string

String returns the time formatted using the format string

func (EpochTime) Unix

func (e EpochTime) Unix() int64

Unix returns the time formatted as seconds since Jan 1st, 1970

func (*EpochTime) UnmarshalJSON

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

UnmarshalJSON is responsible for unmarshaling the EpochTime type.

type MapStringInterface

type MapStringInterface map[string]interface{}

MapStringInterface is used for custom unmarshaling of fields that have potentially dynamic types. E.g. when a field can be a string or an object/map

func (*MapStringInterface) UnmarshalJSON

func (c *MapStringInterface) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom unmarshal method to guard against fields that can have more than one type returned from an API.

Jump to

Keyboard shortcuts

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