timeprovider

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTimeProvider

type MockTimeProvider struct {
	mock.Mock
}

MockTimeProvider is a mock implementation of the TimeProvider interface

func NewMockTimeProvider

func NewMockTimeProvider() *MockTimeProvider

NewMockTimeProvider creates a new instance of MockTimeProvider

func (*MockTimeProvider) IsExpired

func (m *MockTimeProvider) IsExpired(expiryTime int64) bool

IsExpired mocks the IsExpired method

func (*MockTimeProvider) Now

func (m *MockTimeProvider) Now() time.Time

Now mocks the Now method

type RealTimeProvider

type RealTimeProvider struct{}

func (*RealTimeProvider) IsExpired

func (rtp *RealTimeProvider) IsExpired(expiryTime int64) bool

func (*RealTimeProvider) Now

func (rtp *RealTimeProvider) Now() time.Time

type TimeProvider

type TimeProvider interface {
	Now() time.Time
	IsExpired(expiryTime int64) bool
}

func DefaultTimeProvider

func DefaultTimeProvider() TimeProvider

Jump to

Keyboard shortcuts

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