cache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connection

func Connection() redis.Conn

Connection connects to redis once and returns the connection

func DeactivateURL

func DeactivateURL(urlModel model.URL)

DeactivateURL deactivates cache of an expired/deleted model.URL PS, this operation is always cached so Gone (410) can be served without db hit.

func LookupURL

func LookupURL(shortCode string) (model.URL, int)

LookupURL looks up if certain short code is popular enough to be in cache It returns model.URL so the request can be served right way without db hit.

func SavePopularURL

func SavePopularURL(urlModel model.URL, force bool)

SavePopularURL saves a model.URL to cache If force is passed, it saves even if already exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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