Versions in this module Expand all Collapse all v0 v0.1.0 Apr 5, 2017 Changes in this version + var ErrShortEmpty = errors.New("provided short name is of zero length") + var ErrShortExhaustion = errors.New("tried to set short, but unable to find a unique shortname within 10 tries") + var ErrShortNotSet = errors.New("storage layer doens't have a URL for that short code") + var ErrURLEmpty = errors.New("provided URL is of zero length") + var ErrURLNotAbsolute = errors.New("provided URL is not an absolute URL") + var SupportedStorageTypes = make(map[string]interface{}) + func CleanPath(path string) string + func FlattenPath(path string, separator string) string + type Filesystem struct + Root string + func NewFilesystem(root string) (*Filesystem, error) + func (s *Filesystem) Code(url string) string + func (s *Filesystem) Load(rawShort string) (string, error) + func (s *Filesystem) Save(url string) (string, error) + func (s *Filesystem) SaveName(rawShort, url string) error + type Inmem struct + RandLength int + func NewInmem(randLength int) (*Inmem, error) + func NewInmemFromMap(randLength int, initialShorts map[string]string) (*Inmem, error) + func (s *Inmem) Load(rawShort string) (string, error) + func (s *Inmem) Save(url string) (string, error) + func (s *Inmem) SaveName(rawShort string, url string) error + func (s Inmem) String() string + type NamedStorage interface + SaveName func(short string, url string) error + type Regex struct + func NewRegexFromList(redirects map[string]string) (*Regex, error) + func (r Regex) Load(short string) (string, error) + func (r Regex) SaveName(short string, long string) (string, error) + type S3 struct + BucketName string + Client *s3.S3 + func NewS3(awsSession *session.Session, bucketName string) (*S3, error) + func (s *S3) Load(rawShort string) (string, error) + func (s *S3) Save(url string) (string, error) + func (s *S3) SaveName(rawShort string, url string) error + type Storage interface + Load func(short string) (string, error) + type UnnamedStorage interface + Save func(url string) (string, error)