urlsvc

package
v0.0.0-...-a03c5e1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyGenFailed     = errors.New("cannot generate new random string as short url")
	ErrKeyAlreadyExists = errors.New("given static key already exists")
	ErrURLNotFound      = urlrepo.ErrURLNotFound
)

Functions

This section is empty.

Types

type URLSvc

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

func ProvideURLSvc

func ProvideURLSvc(repo urlrepo.Repository, logger *zap.Logger, gen generator.Generator) *URLSvc

func (*URLSvc) Create

func (s *URLSvc) Create(ctx context.Context, address string, expire *time.Time) (string, error)

func (*URLSvc) CreateWithKey

func (s *URLSvc) CreateWithKey(ctx context.Context, key string, address string, expire *time.Time) error

func (*URLSvc) Visit

func (s *URLSvc) Visit(ctx context.Context, key string) (url.URL, error)

Jump to

Keyboard shortcuts

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