db

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BOLT  = "bolt"
	REDIS = "redis"
)
View Source
const KEY_NUMS = "KEY_NUMS"

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Close() error
	Len() int64
	Store(URL *types.URL) error
	GetShort(hashSum string) (URL *types.URL, err error)
	GetLong(short string) (URL *types.URL, err error)
}

Database is a KV storage, there are two relationships hashSum -> short & short -> long hashSum is the URL's hashSum

func New

func New(conf config.StoreConfig) (Database, error)

New DB storage

Jump to

Keyboard shortcuts

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