database

package
v0.0.0-...-1d13ee8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB(dbConfig *redis.Options) *redis.Client

ConnectDB make new database connection.

func InitDB

func InitDB(addr string, user string, password string, db int) *redis.Options

InitDB initialise redis connection settings.

func Ping

func Ping(db *redis.Client) error

Ping test connection to Redis database.

Types

type DBConfig

type DBConfig struct {
	DB *redis.Client
}

func (DBConfig) InsertPaste

func (config DBConfig) InsertPaste(key string, content string, secret string, ttl time.Duration)

func (DBConfig) URLExist

func (config DBConfig) URLExist(url string) bool

func (DBConfig) VerifySecret

func (config DBConfig) VerifySecret(url string, token string) (bool, error)

Jump to

Keyboard shortcuts

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