response

package
v2.0.0-...-1fe9aa2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "response"
)

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *cache.Client

func New

func New(configs Configs, rdb *redisext.Client) (*cache.Client, error)

func ToContext

func ToContext(ctx context.Context, client *cache.Client) context.Context

Types

type Configs

type Configs struct {
	ResponseCacheDuration time.Duration `env:"RESPONSE_CACHE_DURATION" envDefault:"5m"`
}

type RedisAdapter

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

func NewRedisAdapter

func NewRedisAdapter(rdb *redisext.Client) *RedisAdapter

func (RedisAdapter) Get

func (a RedisAdapter) Get(ctx context.Context, key uint64) ([]byte, bool)

func (RedisAdapter) Release

func (a RedisAdapter) Release(ctx context.Context, key uint64)

func (RedisAdapter) Set

func (a RedisAdapter) Set(ctx context.Context, key uint64, response []byte, expiration time.Time)

Jump to

Keyboard shortcuts

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