shortlink

package module
v0.0.0-...-15c8a59 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

build

Shortlink apis redirect URLs. So you might click https://drd.xyz/quick-search and it'll take you to https://www.google.com/search?q=quick+search.

Documentation

Index

Constants

View Source
const (
	TablenameShortlink = "shortlinks"
)

Variables

View Source
var (
	ErrGuildIDEmpty = fmt.Errorf("")
	MemDBSchema     = map[string]*memdb.TableSchema{
		"shortlinks": &memdb.TableSchema{
			Name: TablenameShortlink,
			Indexes: map[string]*memdb.IndexSchema{
				"id": &memdb.IndexSchema{
					Name:    "id",
					Unique:  true,
					Indexer: &memdb.StringFieldIndex{Field: "Path"},
				},
			},
		},
	}
)

Functions

func GetRedirectHandler

func GetRedirectHandler(db *memdb.MemDB, basepath string) http.Handler

Types

type Shortlink struct {
	Path       string
	Redirect   string
	StatusCode int
}

Jump to

Keyboard shortcuts

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