epoch

package module
v0.0.0-...-fc1e1de Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

epoch

epoch simplifies the usage of an int64 to represent time

Documentation

Overview

Copyright 2020 Matt Ho

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Seconds

type Seconds int64

Seconds represents seconds since unix epoch

func From

func From(t time.Time) Seconds

From returns the epoch seconds from a given time

func Now

func Now() Seconds

Now returns current time expressed as seconds

func (Seconds) Add

func (s Seconds) Add(d time.Duration) Seconds

Add duration to an int64

func (Seconds) Int64

func (s Seconds) Int64() int64

Int64 represents an int64

func (Seconds) MarshalDynamoDBAttributeValue

func (s Seconds) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error

MarshalDynamoDBAttributeValue implements dynamodbattribute.Marshaler

func (Seconds) MarshalJSON

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

MarshalJSON implements json.Marshaler

func (Seconds) Time

func (s Seconds) Time() time.Time

TimeInLocation returns time in default location

func (Seconds) TimeInLocation

func (s Seconds) TimeInLocation(loc *time.Location) time.Time

TimeInLocation returns time in specified location

func (*Seconds) UnmarshalDynamoDBAttributeValue

func (s *Seconds) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error

UnmarshalDynamoDBAttributeValue implements dynamodbattribute.Unmarshaler

func (*Seconds) UnmarshalJSON

func (s *Seconds) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

Jump to

Keyboard shortcuts

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