epoch

package
v0.0.0-...-bc6c5c1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Second = "sec"
	Minute = "min"
	Hour   = "hr"
	Day    = "day"
	Week   = "wk"
	Month  = "mo"
	Year   = "yr"
)
View Source
const (
	Scale = int64(time.Millisecond)
)

Variables

Functions

This section is empty.

Types

type Ago

type Ago struct {
	String string
	Unit   string
	Value  int64
}

type Millis

type Millis int64

func Duration

func Duration(d time.Duration) Millis

func Now

func Now() Millis

func Time

func Time(t time.Time) Millis

func UnixNano

func UnixNano(v int64) Millis

func (Millis) Add

func (em Millis) Add(d time.Duration) Millis

func (Millis) Ago

func (em Millis) Ago() Ago

func (Millis) AttributeValue

func (em Millis) AttributeValue() *dynamodb.AttributeValue

func (Millis) Format

func (em Millis) Format(layout string) string

func (Millis) Int64

func (em Millis) Int64() int64

func (Millis) MarshalJSON

func (em Millis) MarshalJSON() ([]byte, error)

func (Millis) Resolver

func (em Millis) Resolver() *Resolver

Resolver provides a resolver usable by github.com/neelance/graphql-go

type Epoch {
	date: String!
	time: String!
	secs: Int!
	ago: String!
}

func (*Millis) Scan

func (em *Millis) Scan(src interface{}) error

func (Millis) Time

func (em Millis) Time() time.Time

func (*Millis) UnmarshalJSON

func (em *Millis) UnmarshalJSON(data []byte) error

func (Millis) Value

func (em Millis) Value() (driver.Value, error)

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver provides a resolver usable by github.com/neelance/graphql-go

type Epoch {
	date: String!
	time: String!
	secs: Int!
	ago: String!
}

func (*Resolver) Ago

func (r *Resolver) Ago() string

func (*Resolver) Date

func (r *Resolver) Date() string

func (*Resolver) Secs

func (r *Resolver) Secs() int32

func (*Resolver) Time

func (r *Resolver) Time() string

Jump to

Keyboard shortcuts

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