usecase

package
v0.0.0-...-de806f4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UsecaseSet = wire.NewSet(
	NewTinyURLUsecase,
)

Functions

This section is empty.

Types

type TinyURLUsecase

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

func NewTinyURLUsecase

func NewTinyURLUsecase(store URLStore) *TinyURLUsecase

func (*TinyURLUsecase) Access

func (usecase *TinyURLUsecase) Access(ctx context.Context, id string) (*entity.TinyURL, error)

func (*TinyURLUsecase) Generate

func (usecase *TinyURLUsecase) Generate(ctx context.Context, u *url.URL) (*entity.TinyURL, error)

func (*TinyURLUsecase) Peek

func (usecase *TinyURLUsecase) Peek(ctx context.Context, id string) (*entity.TinyURL, error)

type URLStore

type URLStore interface {
	Create(ctx context.Context, url *entity.TinyURL) error
	Find(ctx context.Context, id string) (*entity.TinyURL, error)
}

Directories

Path Synopsis
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.

Jump to

Keyboard shortcuts

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