data

package
v0.0.0-...-696e5ce Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCode

func GenCode(n int) string

GenCode for a short URL at a specific length. Barrowed from: https://stackoverflow.com/a/31832326

Types

type Redis

type Redis struct {
	CharFloor int
	Client    *redis.Client
	Conn      *redis.Options
}

Redis data struct

func (*Redis) Init

func (r *Redis) Init()

Init connection to Redis server

func (Redis) Load

func (r Redis) Load(code string) (string, error)

Load grabs data from redis

func (*Redis) Save

func (r *Redis) Save(url string, ttl int64, stats string) (string, error)

Save saves data to redis

func (Redis) Stats

func (r Redis) Stats(code string) (string, error)

Stats retrieves current stats on a code.

Jump to

Keyboard shortcuts

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