timeprovider

package
v0.0.0-...-1967991 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const UTCFormat = "2006-01-02T15:04:05Z"

Variables

This section is empty.

Functions

func DateToUTCString

func DateToUTCString(date time.Time) string

func UTCStringToDate

func UTCStringToDate(utcString string) (time.Time, error)

Types

type MockTimeProvider

type MockTimeProvider struct {
	MockTime time.Time
}

func (MockTimeProvider) Now

func (provider MockTimeProvider) Now() time.Time

func (MockTimeProvider) UTCString

func (provider MockTimeProvider) UTCString() string

type RealTimeProvider

type RealTimeProvider struct{}

func (RealTimeProvider) Now

func (RealTimeProvider) Now() time.Time

func (RealTimeProvider) UTCString

func (time RealTimeProvider) UTCString() string

type TimeProvider

type TimeProvider interface {
	Now() time.Time
	UTCString() string
}

Jump to

Keyboard shortcuts

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