timeproxy

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package time proxy is a package that provides a time proxy for the app.

Index

Constants

View Source
const (
	// Millisecond is  a proxy for time.Millisecond.
	Millisecond = time.Millisecond
)

Variables

View Source
var UTC = *time.UTC

UTC is a variable for time.UTC.

Functions

This section is empty.

Types

type Time

type Time interface {
	Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) *TimeInstance
	Now() *TimeInstance
}

Time is an interface for time.

func New

func New() Time

New is a constructor for TimeProxy.

type TimeInstance

type TimeInstance struct {
	FieldTime time.Time
}

TimeInstance is a struct that implements TimeInstanceInterface.

func (*TimeInstance) Format

func (t *TimeInstance) Format(layout string) string

Format is a proxy for time.Time.Format.

func (*TimeInstance) Scan

func (t *TimeInstance) Scan(value interface{}) error

Scan implements the sql.Scanner interface.

func (*TimeInstance) Value

func (t *TimeInstance) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type TimeInstanceInterface

type TimeInstanceInterface interface {
	Format(layout string) string
	Scan(value interface{}) error
	Value() (driver.Value, error)
}

TimeInstanceInterface is an interface for time.Time.

type TimeProxy

type TimeProxy struct{}

TimeProxy is a struct that implements Time.

func (*TimeProxy) Date

func (t *TimeProxy) Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) *TimeInstance

Date is a proxy for time.Date.

func (*TimeProxy) Now

func (*TimeProxy) Now() *TimeInstance

Now is a proxy for time.Now.

Jump to

Keyboard shortcuts

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