cache

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

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthErrorRedirect

func AuthErrorRedirect(w http.ResponseWriter, r *http.Request)

AuthErrorRedirect redirects the user to the original proxied URL with a HTTP status of 301 ("Moved Permanently").

func NewImageProxy

func NewImageProxy() http.Handler

NewImageProxy returns an HTTP handler that serves as a reverse image proxy for the given request. Cookie verification is already handled by the time the request arrives here.

Types

type RetrievalCache

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

RetrievalCache is a probabilistic cache to determine if an article has ever retrieved seen before.

func StartRetrievalCache

func StartRetrievalCache(ctx context.Context, d *storage.Database) *RetrievalCache

StartRetrievalCache creates a new RetrievalCache and starts background processing.

func (*RetrievalCache) Add

func (r *RetrievalCache) Add(u models.User, entry string)

Add adds a new a entry into the retrieval cache for the specified user.

func (*RetrievalCache) Lookup

func (r *RetrievalCache) Lookup(u models.User, entry string) bool

Lookup returns whether the specified entry is present in the retrieval cache for the specified user.

Jump to

Keyboard shortcuts

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