cache

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cache provides a remote cache based implementation of session store and loader. See pomerium's cache service for more details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Cache        client.Cacher
	Encoder      encoding.MarshalUnmarshaler
	QueryParam   string
	WrappedStore sessions.SessionStore
}

Options represent cache store's available configurations.

type Store

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

Store implements the session store interface using a cache service.

func NewStore

func NewStore(o *Options) *Store

NewStore creates a new cache

func (*Store) ClearSession

func (s *Store) ClearSession(w http.ResponseWriter, r *http.Request)

ClearSession clears the session from the wrapped store.

func (*Store) LoadSession

func (s *Store) LoadSession(r *http.Request) (string, error)

LoadSession looks for a preset query parameter in the request body

representing the key to lookup from the cache.

func (*Store) SaveSession

func (s *Store) SaveSession(w http.ResponseWriter, r *http.Request, x interface{}) error

SaveSession saves the session to the cache, and wrapped store.

Jump to

Keyboard shortcuts

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