types

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DateFormat = "1/2/2006"
)
View Source
const (
	TimestampFormat = "1/2/2006 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date struct {
	time.Time
}

func (*Date) MarshalCSV

func (d *Date) MarshalCSV() (string, error)

Convert the internal date as CSV string

func (*Date) UnmarshalCSV

func (d *Date) UnmarshalCSV(csv string) (err error)

Convert the CSV string as internal date

type Dates

type Dates []time.Time

func (*Dates) MarshalCSV

func (date *Dates) MarshalCSV() (string, error)

Convert the internal date as CSV string

func (*Dates) UnmarshalCSV

func (date *Dates) UnmarshalCSV(csv string) (err error)

Convert the CSV string as internal date

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) MarshalCSV

func (d *Duration) MarshalCSV() (string, error)

Convert the internal date as CSV string

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Duration) UnmarshalCSV

func (d *Duration) UnmarshalCSV(csv string) (err error)

Convert the CSV string as internal date

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

type StringSlice added in v0.0.6

type StringSlice []string

func (*StringSlice) MarshalCSV added in v0.0.6

func (s *StringSlice) MarshalCSV() (string, error)

Convert the internal date as CSV string

func (*StringSlice) String added in v0.0.6

func (s *StringSlice) String() string

You could also use the standard Stringer interface

func (*StringSlice) UnmarshalCSV added in v0.0.6

func (s *StringSlice) UnmarshalCSV(csv string) error

Convert the CSV string as internal date

type Timestamp

type Timestamp struct {
	time.Time
}

func (*Timestamp) MarshalCSV

func (date *Timestamp) MarshalCSV() (string, error)

Convert the internal date as CSV string

func (*Timestamp) UnmarshalCSV

func (date *Timestamp) UnmarshalCSV(csv string) (err error)

Convert the CSV string as internal date

Jump to

Keyboard shortcuts

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