shorturls

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShortURLBadRequest   = errutil.NewBase(errutil.StatusBadRequest, "shorturl.bad-request")
	ErrShortURLNotFound     = errutil.NewBase(errutil.StatusNotFound, "shorturl.not-found")
	ErrShortURLAbsolutePath = errutil.NewBase(errutil.StatusValidationFailed, "shorturl.absolute-path", errutil.WithPublicMessage("Path should be relative"))
	ErrShortURLInvalidPath  = errutil.NewBase(errutil.StatusValidationFailed, "shorturl.invalid-path", errutil.WithPublicMessage("Invalid short URL path"))
	ErrShortURLInternal     = errutil.NewBase(errutil.StatusInternal, "shorturl.internal")
)

Functions

This section is empty.

Types

type DeleteShortUrlCommand

type DeleteShortUrlCommand struct {
	OlderThan time.Time

	NumDeleted int64
}

type Service

type Service interface {
	GetShortURLByUID(ctx context.Context, user *user.SignedInUser, uid string) (*ShortUrl, error)
	CreateShortURL(ctx context.Context, user *user.SignedInUser, path string) (*ShortUrl, error)
	UpdateLastSeenAt(ctx context.Context, shortURL *ShortUrl) error
	DeleteStaleShortURLs(ctx context.Context, cmd *DeleteShortUrlCommand) error
}

type ShortUrl

type ShortUrl struct {
	Id         int64
	OrgId      int64
	Uid        string
	Path       string
	CreatedBy  int64
	CreatedAt  int64
	LastSeenAt int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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