mirror of
https://github.com/jimeh/ozu.io.git
synced 2026-02-19 08:06:39 +00:00
Break out structs and errors into separate files in storage package
This commit is contained in:
6
storage/errors.go
Normal file
6
storage/errors.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package storage
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrNotFound is the default error message when data is not found.
|
||||
var ErrNotFound = errors.New("not found")
|
||||
7
storage/record.go
Normal file
7
storage/record.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package storage
|
||||
|
||||
// Record provides a standard way to refer to a shortened URL.
|
||||
type Record struct {
|
||||
UID []byte
|
||||
URL []byte
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
package storage
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrNotFound is the default error message when data is not found.
|
||||
var ErrNotFound = errors.New("not found")
|
||||
|
||||
// Store defines a standard interface for storage
|
||||
type Store interface {
|
||||
Close() error
|
||||
@@ -15,9 +10,3 @@ type Store interface {
|
||||
DeleteByURL(URL []byte) (*Record, error)
|
||||
NextSequence() (int, error)
|
||||
}
|
||||
|
||||
// Record provides a standard way to refer to a shortened URL.
|
||||
type Record struct {
|
||||
UID []byte
|
||||
URL []byte
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user