redirect

package
v0.0.0-...-d6130bf Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBSONFromFile

func DecodeBSONFromFile(filePath string, result *Redirects) error

DecodeBSONFromFile reads a BSON file and decodes it into the provided data structure

func EncodeBSONToFile

func EncodeBSONToFile(data *Redirects, filePath string) error

EncodeBSONToFile encodes a BSON document and writes it to a file

func GenerateToken

func GenerateToken(length int) string

func RedirectGetRoute

func RedirectGetRoute(w http.ResponseWriter, r *http.Request)

func RedirectPostRoute

func RedirectPostRoute(w http.ResponseWriter, r *http.Request)

func Routes

func Routes() []router.Route

Types

type Redirect

type Redirect struct {
	Out       string `bson:"out"`
	CreatedAt string `bson:"created_at"`
}

type Redirects

type Redirects struct {
	Redirects map[string]Redirect `bson:"redirects"`
}

Jump to

Keyboard shortcuts

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