storages

package
v0.0.0-...-280c745 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package storages allows multiple implementation on how to store short URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filesystem

type Filesystem struct {
	Root string
	sync.RWMutex
}

func (*Filesystem) Code

func (s *Filesystem) Code() string

func (*Filesystem) Init

func (s *Filesystem) Init(root string) error

func (*Filesystem) Load

func (s *Filesystem) Load(code string) (string, error)

func (*Filesystem) Save

func (s *Filesystem) Save(url string) string

type IStorage

type IStorage interface {
	Code() string
	Save(string) string
	Load(string) (string, error)
}

Jump to

Keyboard shortcuts

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