core

package
v0.0.0-...-3701de1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStorage

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

func NewBoltStorage

func NewBoltStorage(ttl time.Duration, length int, database string) (*BoltStorage, error)

func (*BoltStorage) Contains

func (b *BoltStorage) Contains(uri Uri) bool

func (*BoltStorage) Get

func (b *BoltStorage) Get(uri Uri) (Url, bool)

func (*BoltStorage) Put

func (b *BoltStorage) Put(url Url, exp time.Duration) Uri

type MapStorage

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

func NewMapStorage

func NewMapStorage(ttl time.Duration, length int) (*MapStorage, error)

func (*MapStorage) Contains

func (u *MapStorage) Contains(uri Uri) bool

func (*MapStorage) Get

func (u *MapStorage) Get(uri Uri) (Url, bool)

func (*MapStorage) Put

func (u *MapStorage) Put(url Url, exp time.Duration) Uri

type Uri

type Uri string

func NewUri

func NewUri(length int) Uri

type Url

type Url string

type UrlDesc

type UrlDesc struct {
	Url       Url
	ExpiresAt time.Time
}

type UrlStorage

type UrlStorage interface {
	Put(url Url, exp time.Duration) Uri
	Get(uri Uri) (Url, bool)
}

Jump to

Keyboard shortcuts

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