rediscache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package rediscache implements a cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache holds cache client.

func New

func New(options Options) (*Cache, error)

New creates a new cache client.

func (*Cache) Expire

func (c *Cache) Expire() error

Expire invalidates token in cache.

func (*Cache) Get

func (c *Cache) Get() (token.Token, error)

Get retrieves token from cache.

func (*Cache) Put

func (c *Cache) Put(t token.Token) error

Put inserts token into cache.

type Options added in v0.1.0

type Options struct {
	// Format: redisString = <host>:<port>:<password>:<key>
	// Example: redisString = localhost:6379::oauth2-client-example
	// Leave <key> empty for auto generation.
	RedisString string
	TokenURL    string // only used if AutoKey is enabled
	ClientID    string // only used if AutoKey is enabled
}

Options define redis options.

Jump to

Keyboard shortcuts

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