redis

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const API_KEY_OK_VALUE = "ok"
View Source
const API_KEY_PENDING_CHECK_VALUE = "pending"
View Source
const API_KEY_PREFIX = "key-"
View Source
const ORIGIN_PREFIX = "origin-"
View Source
const PROCESS_QUEUE_SET_NAME = "api-keys-to-update"
View Source
const USAGE_PREFIX = "usage-"

Variables

View Source
var RDB *redis.Client

Functions

func BillCreditsQuickly

func BillCreditsQuickly(ctx context.Context, apiKey string, credits int64) error

func CheckAPIKeyQuickly

func CheckAPIKeyQuickly(ctx context.Context, apiKey string) (bool, string, error)

func GetSpan added in v0.0.3

func GetSpan(ctx context.Context, name string) (context.Context, trace.Span)

func LogError added in v0.0.3

func LogError(c context.Context, err error, message string)

func SetupRedis

func SetupRedis() func(context.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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