mock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockLinkData []domain.Link = []domain.Link{
	{Id: "testid1", OriginalURL: "https://example.com/link1"},
	{Id: "testid2", OriginalURL: "https://example.com/link2"},
	{Id: "testid3", OriginalURL: "https://example.com/link3"},
}

Functions

This section is empty.

Types

type MockLinkRepo

type MockLinkRepo struct {
	Links []domain.Link
}

func NewMockLinkRepo

func NewMockLinkRepo() *MockLinkRepo

func (*MockLinkRepo) All

func (m *MockLinkRepo) All(ctx context.Context) ([]domain.Link, error)

func (*MockLinkRepo) Create

func (m *MockLinkRepo) Create(ctx context.Context, link domain.Link) error

func (*MockLinkRepo) Delete

func (m *MockLinkRepo) Delete(ctx context.Context, id string) error

func (*MockLinkRepo) Get

func (m *MockLinkRepo) Get(ctx context.Context, id string) (domain.Link, error)

type MockRedisCache

type MockRedisCache struct {
	Store map[string]string
	TTL   map[string]time.Time
}

func NewMockRedisCache

func NewMockRedisCache() *MockRedisCache

func (*MockRedisCache) Delete

func (m *MockRedisCache) Delete(ctx context.Context, key string) error

func (*MockRedisCache) Get

func (m *MockRedisCache) Get(ctx context.Context, key string) (string, error)

func (*MockRedisCache) Set

func (m *MockRedisCache) Set(ctx context.Context, key string, val string) error

Jump to

Keyboard shortcuts

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