cache

package
v0.0.0-...-2d572df Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStateStore

type RedisStateStore struct {
	Client      *redis.Client
	IDGenerator utils.IDGenerator
	Prefix      string
}

RedisStateStore is a redis backed implementation of StateStore

func (*RedisStateStore) Del

func (r *RedisStateStore) Del(key string) (bool, error)

Del removes the given key returns true if a key was removed.

func (*RedisStateStore) Exists

func (r *RedisStateStore) Exists(key string) (bool, error)

Exists checks whether the given key exists in cache

func (*RedisStateStore) Get

func (r *RedisStateStore) Get(key string) (string, error)

Get returns the payload stored at a key

func (*RedisStateStore) Set

func (r *RedisStateStore) Set(payload string, exp time.Duration) (string, error)

Set stores the payload under a new random key, which is returned. exp sets the lifetime for the key.

type StateStore

type StateStore interface {
	Exists(string) (bool, error)
	Set(string, time.Duration) (string, error)
	Del(string) (bool, error)
	Get(string) (string, error)
}

StateStore defines an interface for caching state parameters during the OAuth authentication processes

Jump to

Keyboard shortcuts

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