app

package
v0.0.0-...-113819d Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorRedirectNotFound = errors.New("Redirect not found")
	ErrorRedirectInvalid  = errors.New("Redirect is invalid")
)

Functions

This section is empty.

Types

type Redirect

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

type RedirectRepository

type RedirectRepository 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(repo RedirectRepository) RedirectService

Jump to

Keyboard shortcuts

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