shortener

package
v0.0.0-...-eecc4ce Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRedirectNotFound = errors.New("Redirect Not Found")
	ErrRedirectInvalid  = errors.New("Redirect Invalid")
)

Functions

This section is empty.

Types

type Redirect

type Redirect struct {
	Code      string `json:"code" bson:"code" msgpack:"code" xml:"code"`
	URL       string `json:"url" bson:"url" msgpack:"url" xml:"url" validate:"empty=false & format=url"`
	CreatedAt int64  `json:"created_at" bson:"created_at" msgpack:"created_at" xml:"created_at"`
}

type RedirectRepo

type RedirectRepo interface {
	Find(code string) (*Redirect, error)
	Store(redirect *Redirect) error
}

type RedirectSerializer

type RedirectSerializer interface {
	Decode(input []byte) (*Redirect, error)
	Encode(input *Redirect) ([]byte, error)
}

type RedirectService

type RedirectService interface {
	Find(code string) (*Redirect, error)
	Store(redirect *Redirect) error
}

func NewRedirectService

func NewRedirectService(redirectRepo RedirectRepo) RedirectService

Jump to

Keyboard shortcuts

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