src

package
v0.0.0-...-0dcff51 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func HandleBasic

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

func HandleSlug

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

func LoadConfig

func LoadConfig(path string)

Types

type Config

type Config struct {
	Origin       string
	Redirections []Redirect
	Credentials  DatabaseCredentials
}
var Cfg Config

type DatabaseCredentials

type DatabaseCredentials struct {
	Host     string
	User     string
	Password string
	DBName   string
	Port     uint
}

func (*DatabaseCredentials) Connect

func (credentials *DatabaseCredentials) Connect()

func (*DatabaseCredentials) GenerateDSN

func (credentials *DatabaseCredentials) GenerateDSN() string

type Location

type Location struct {
	Origin string
	Uri    string
}

type Path

type Path string

type Redirect

type Redirect struct {
	Id   string
	Path Path
}

type Redirection

type Redirection struct {
	gorm.Model
	Slug        string
	Destination string
}

Jump to

Keyboard shortcuts

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