server

package
v0.0.0-...-61649fe Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package server provides a New func for spinning up a new API server.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidShortURL = errors.New("please ensure you have a correct short URL, cannot be found")

ErrInvalidShortURL is returned from redirectToLongURL if the short URL in question cannot be found

Functions

This section is empty.

Types

type API

type API struct {
	Mux *chi.Mux
	// contains filtered or unexported fields
}

API is a structure that orchestrates our http layer, database, and the communication between the them.

func New

func New(db storage.URLRepository) *API

New takes a storage.Repository and set's up an API server, using the store.

Jump to

Keyboard shortcuts

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