short

package
v0.0.0-...-8f868aa Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package short implements a simple URL shortener, serving shortened urls from /s/key. An administrative handler is provided for other services to use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminHandler

func AdminHandler(dc *datastore.Client, mc *memcache.Client) http.HandlerFunc

AdminHandler serves an administrative interface for managing shortener entries. Be careful. It is the caller’s responsibility to ensure that the handler is only exposed to authorized users.

func RegisterHandlers

func RegisterHandlers(mux *http.ServeMux, host string, dc *datastore.Client, mc *memcache.Client)

Types

type Link struct {
	Key, Target string
}

Link represents a short link.

Jump to

Keyboard shortcuts

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