redis

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis is a representation of the redis datastore

func Init

func Init(config *config.RedisConfig) (Redis, error)

Init creates a new db connection with given settings

func (*Redis) BumpHitCount

func (db *Redis) BumpHitCount(id string) error

BumpHitCount updates the hit number on a certain link

func (db *Redis) CreateLink(link models.Link) error

CreateLink stores a new link into database

func (db *Redis) DeleteLink(id string) error

DeleteLink removes a link from the database

func (db *Redis) GetAllLinks() (map[string]models.Link, error)

GetAllLinks returns an unpaginated list of current links

func (db *Redis) GetLink(id string) (models.Link, error)

GetLink returns a link by short name

Jump to

Keyboard shortcuts

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