redisbackend

package
v0.0.0-...-d6e685d Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBan

func CheckBan(id, idtoken string) bool

Get if any token is banned

func GetFeedCache

func GetFeedCache(IDfeed string) string

Returns the feed cache values

func InsertBanidtoken

func InsertBanidtoken(idtoken string) error

Get if any token is banned

func InsertFeedCache

func InsertFeedCache(data, value string)

InsertFeedCache

func RemoveBan

func RemoveBan(id primitive.ObjectID) error

remove a user's ban on redis

func SetBan

func SetBan(Info UserRedisJson) error

Insert ban to user in redisdb

func SetBanToken

func SetBanToken(Token, details string) error

Types

type TokenBan

type TokenBan struct {
	Reason  string `bson:"Reason"`
	Details string `bson:"Details"`
}

type UserRedisJson

type UserRedisJson struct {
	ID           primitive.ObjectID `bson:"_id" `
	Blocked      bool               `bson:"Blocked"`
	Reason       string             `bson:"Reason"`
	LoginAttempt int                `bson:"LoginAttempt"`
	Details      string             `bson:"Details"`
}

User-specific structure used in redis

Jump to

Keyboard shortcuts

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