usecases

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

type Hasher struct {
	// contains filtered or unexported fields
}

func NewHasher

func NewHasher(hasher hash.Hash) *Hasher

func (*Hasher) Hash

func (uc *Hasher) Hash(val string) *dtos.HashGetter

type URL

type URL struct {
	// contains filtered or unexported fields
}

func NewURL

func NewURL(
	repo interfaces.URLRepo, hash interfaces.Hash, opts ...URLOpt,
) *URL

func (*URL) GetFullURL

func (uc *URL) GetFullURL(ctx context.Context, hash string) (string, error)

func (*URL) GetHash

func (uc *URL) GetHash(ctx context.Context, fullURL string) (string, error)

type URLOpt

type URLOpt func(*URL)

func WithCache

func WithCache(cache interfaces.Cache[string, string]) URLOpt

func WithLogger

func WithLogger(logger interfaces.Logger) URLOpt

Jump to

Keyboard shortcuts

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