persist

package
v0.0.0-...-df11c48 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeStore

type FakeStore struct {
	URL                         string
	Stored                      []Stored
	SaveErr, ListErr, RemoveErr error
}

FakeStore stores the given data into FakeStore.Stored so user can use It as a fake DB

func (*FakeStore) Exists

func (f *FakeStore) Exists(s string) bool

Exists ...

func (*FakeStore) FindHash

func (f *FakeStore) FindHash(s string) (string, error)

FindHash ...

func (*FakeStore) List

func (f *FakeStore) List() ([]Stored, error)

List ...

func (*FakeStore) Remove

func (f *FakeStore) Remove(dbHash string) error

Remove ...

func (*FakeStore) Save

func (f *FakeStore) Save(linkData *data.LinkData) error

Save ...

type Storage

type Storage interface {
	List() ([]Stored, error)
	Save(linkData *data.LinkData) error
	Remove(dbHash string) error
	FindHash(dbHash string) (string, error)
}

Storage is the interface that holds how the server uses the given data.

type Stored

type Stored struct {
	Link, Short, Hash string
}

Stored is the fake DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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