utils

package
v0.0.0-...-3051362 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Layout = "2006-01-02T15:04:05.000Z07:00"

Layout represent the formatter to be used for time parsing. Go doesn't provide a time parser that support millis time.RFC3339 (no millis) or time.RFC3339nano (nano seconds)

Variables

This section is empty.

Functions

func PerformRequest

func PerformRequest(r http.Handler, method, path string, headers map[string]string) *httptest.ResponseRecorder

func TestRouter

func TestRouter() *gin.Engine

Types

type ISO8601Time

type ISO8601Time time.Time

ISO8601Time represents a date time that can be marshalled and unmarshalled following the ISO 8601 convention.

func (*ISO8601Time) MarshalJSON

func (t *ISO8601Time) MarshalJSON() ([]byte, error)

MarshalJSON creates a JSON representation for a date, following the ISO 8601 convention.

func (*ISO8601Time) String

func (t *ISO8601Time) String() string

String returns the string representation using ISO8601 format

func (*ISO8601Time) UnmarshalJSON

func (t *ISO8601Time) UnmarshalJSON(b []byte) error

UnmarshalJSON parses a JSON representation, following the ISO 8601 convention, to a time element.

Jump to

Keyboard shortcuts

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