Imported project in git, removed bindata dependency
This commit is contained in:
@ -2,7 +2,7 @@ package bolt
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"qurl/qurl"
|
||||
"git.binarythought.com/cdramey/qurl/obj"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -15,7 +15,7 @@ var (
|
||||
BrowserField = []byte{0x03}
|
||||
)
|
||||
|
||||
func (stor *BoltStorage) AddQURL(q *qurl.QURL) error {
|
||||
func (stor *BoltStorage) AddQURL(q *obj.QURL) error {
|
||||
tx, err := stor.DB.Begin(true)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -122,7 +122,7 @@ func (stor *BoltStorage) SetQURLSequence(seq uint64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (stor *BoltStorage) GetQURLByURL(u string) (*qurl.QURL, error) {
|
||||
func (stor *BoltStorage) GetQURLByURL(u string) (*obj.QURL, error) {
|
||||
tx, err := stor.DB.Begin(false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -149,7 +149,7 @@ func (stor *BoltStorage) GetQURLByURL(u string) (*qurl.QURL, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
q := &qurl.QURL{ID: binary.BigEndian.Uint64(bid)}
|
||||
q := &obj.QURL{ID: binary.BigEndian.Uint64(bid)}
|
||||
|
||||
qu := qb.Get(URLField)
|
||||
if qu != nil {
|
||||
@ -159,7 +159,7 @@ func (stor *BoltStorage) GetQURLByURL(u string) (*qurl.QURL, error) {
|
||||
return q, nil
|
||||
}
|
||||
|
||||
func (stor *BoltStorage) GetQURLByID(id uint64) (*qurl.QURL, error) {
|
||||
func (stor *BoltStorage) GetQURLByID(id uint64) (*obj.QURL, error) {
|
||||
tx, err := stor.DB.Begin(false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -180,7 +180,7 @@ func (stor *BoltStorage) GetQURLByID(id uint64) (*qurl.QURL, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
q := &qurl.QURL{ID: id}
|
||||
q := &obj.QURL{ID: id}
|
||||
|
||||
qu := qb.Get(URLField)
|
||||
if qu != nil {
|
||||
|
@ -3,15 +3,15 @@ package storage
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"qurl/qurl"
|
||||
"qurl/storage/bolt"
|
||||
"git.binarythought.com/cdramey/qurl/obj"
|
||||
"git.binarythought.com/cdramey/qurl/storage/bolt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Storage interface {
|
||||
AddQURL(*qurl.QURL) error
|
||||
GetQURLByURL(string) (*qurl.QURL, error)
|
||||
GetQURLByID(uint64) (*qurl.QURL, error)
|
||||
AddQURL(*obj.QURL) error
|
||||
GetQURLByURL(string) (*obj.QURL, error)
|
||||
GetQURLByID(uint64) (*obj.QURL, error)
|
||||
SetQURLSequence(uint64) error
|
||||
Backup(string) error
|
||||
Shutdown()
|
||||
|
Reference in New Issue
Block a user