Versions in this module Expand all Collapse all v0 v0.1.1 Oct 5, 2022 v0.1.0 Oct 5, 2022 Changes in this version + type Config interface + WithHost func(host string) Config + WithMongoUri func(mongoUri string) Config + func DefaultConfig() Config + type ConflictError struct + func (e *ConflictError) Error() string + type IdNotFoundError struct + func (e *IdNotFoundError) Error() string + type ShortenedURL interface + GetUrl func() string + type Shortener interface + CreateShortenedUrl func(ctx context.Context, url string, config ...UrlConfig) (ShortenedURL, error) + GetUrlFromShortenedUrl func(ctx context.Context, surl string) (string, error) + GetUrlFromShortenedUrlId func(ctx context.Context, id string) (string, error) + func NewShortener(config ...Config) (Shortener, error) + type Store interface + GetUrl func(ctx context.Context, id string) (string, error) + Insert func(ctx context.Context, ic *insertConfig) error + func NewStore(mongoUri string, name string) (Store, error) + type UrlConfig interface + WithAlias func(alias string) UrlConfig + WithExpirationDate func(expriationDate time.Time) UrlConfig + WithOverrideAlias func(override bool) UrlConfig + func DefaultUrlConfig() UrlConfig