persistence

package
v0.0.0-...-7ea2498 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

func NewMemory

func NewMemory() *Memory

func (*Memory) Count

func (m *Memory) Count() int

func (*Memory) Get

func (m *Memory) Get(alias string) (url string, found bool)

func (*Memory) Increment

func (m *Memory) Increment() error

func (*Memory) Set

func (m *Memory) Set(alias, url string) error

type Redis

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

func NewRedis

func NewRedis(address, password string, database int) *Redis

func (*Redis) Count

func (m *Redis) Count() int

func (*Redis) Get

func (m *Redis) Get(alias string) (url string, found bool)

func (*Redis) Increment

func (m *Redis) Increment() error

func (*Redis) Set

func (m *Redis) Set(alias, url string) error

type Storage

type Storage interface {
	Set(alias, url string) error
	Get(alias string) (url string, found bool)
	Count() int
	Increment() error
}

Jump to

Keyboard shortcuts

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