types

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package types provides custom types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnixString

type UnixString time.Time

UnixString is a time.Time disguise as unix timestamp.

func ParseUnixString

func ParseUnixString(s string) (UnixString, error)

ParseUnixString parses a unix timestamp string to UnixString.

func UnixStringDate

func UnixStringDate(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) UnixString

UnixStringDate creates a new UnixString from a date time.

func UnixStringSec

func UnixStringSec(sec int64) UnixString

UnixStringSec creates a new UnixString from a unix timestamp.

func (UnixString) MarshalJSON

func (s UnixString) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler interface.

func (UnixString) Sec

func (s UnixString) Sec() int64

Sec returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC.

func (UnixString) String

func (s UnixString) String() string

String returns a unix timestamp string.

func (UnixString) Time

func (s UnixString) Time() time.Time

Time returns time.Time.

func (*UnixString) UnmarshalJSON

func (s *UnixString) UnmarshalJSON(src []byte) error

UnmarshalJSON satisfies json.Unmarshaler interface.

Jump to

Keyboard shortcuts

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