db

package
v0.0.0-...-5b2b5ad Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatabaseName -> Name of the Database
	DatabaseName = "gme-shorts"
	// ShortenedCollectionName -> Name of the collection
	ShortenedCollectionName = "stonks"
)

Variables

This section is empty.

Functions

func NewRedisClient

func NewRedisClient(cfg *config.RedisConfig) *redis.Client

NewRedisClient -> Create a new Redis client

Types

type Database

type Database interface {
	FindShortenedURL(id string) (res *short.ShortURL, err error)
	SaveShortenedURL(url short.ShortURL) (err error)
	BreakCache(id string) (found bool)
}

Database -> Database Interface

func NewBBoltDatabase

func NewBBoltDatabase(path string) (Database, error)

NewBBoltDatabase -> Create new BBoltDatabase

func NewMongoDatabase

func NewMongoDatabase(connectionString string) (db Database, err error)

NewMongoDatabase -> Create a new MongoDB

Jump to

Keyboard shortcuts

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