shorturl

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 8 Imported by: 0

README

shorturl

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReverseCharset = [256]byte{}
	ErrInvalid     = errors.New("invalid code")
)

Functions

func Decode

func Decode(s string) (uint64, error)

func Encode

func Encode(i uint64) string

func Validate

func Validate(s string) bool

func WithBaseURL

func WithBaseURL(baseURL string) func(*Handler)

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(storage storage.Storage, opts ...func(*Handler)) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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