service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...ServiceOption) *svc

New instantiates a new service.

Types

type NewLinkOption added in v0.1.1

type NewLinkOption func(*model.Link) error

func WithShortURL added in v0.1.1

func WithShortURL(want string) NewLinkOption

func WithTTL added in v0.1.1

func WithTTL(ttl time.Duration) NewLinkOption

type Service

type Service interface {
	NewLink(string, ...NewLinkOption) (model.Link, error)
	ShortURLToLink(string) (model.Link, error)
}

Service defines the interface exposed by this package.

type ServiceOption added in v0.1.1

type ServiceOption func(*svc) error

func WithBasicStorage added in v0.1.1

func WithBasicStorage() ServiceOption

func WithRedisStorage added in v0.1.1

func WithRedisStorage() ServiceOption

Jump to

Keyboard shortcuts

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