utils

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendResponse

func SendResponse(c *gin.Context, response Response)

Types

type DataAccessLayer

type DataAccessLayer interface {
	Scan(uint64, string, int64) *redis.ScanCmd
	Get(string) (string, error)
	Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd
}

func InitRedisClient

func InitRedisClient(options *redis.Options) DataAccessLayer

type RedisDAL

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

func (*RedisDAL) Get

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

func (*RedisDAL) Scan

func (r *RedisDAL) Scan(cursor uint64, match string, count int64) *redis.ScanCmd

func (*RedisDAL) Set

func (r *RedisDAL) Set(key string, value any, expiration time.Duration) *redis.StatusCmd

type RedisKeyVal

type RedisKeyVal struct {
	Repo    string `json:"repo"`
	Version string `json:"currentVersion"`
}

func GetAllRedisKeysAndValues

func GetAllRedisKeysAndValues(rdb DataAccessLayer) ([]RedisKeyVal, error)

type Response

type Response struct {
	Status  int      `json:"status,omitempty"`
	Message []string `json:"message,omitempty"`
	Error   []string `json:"error,omitempty"`
	Data    any      `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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