Documentation ¶
Index ¶
- Constants
- type BadgerStore
- func (b *BadgerStore) Create(code string, longUrl string) (*models.Link, error)
- func (b *BadgerStore) Delete(code string) int
- func (b *BadgerStore) FindLink(hashedLongUrl string) *models.Link
- func (b *BadgerStore) IncCount() int
- func (b *BadgerStore) List(limit int, skip int) []models.Link
- func (b *BadgerStore) Read(code string) (*models.Link, error)
- type MongoStore
- type Store
Constants ¶
View Source
const ( // :: Config :: MongoCacheCleanup = "MONGO_CACHE_CLEANUP" MongoCacheExp = "MONGO_CACHE_EXP" MongoCounterCollection = "MONGO_COL_COUNTERS" MongoLinksCollection = "MONGO_COL_LINKS" MongoUrl = "MONGO_URL" MongoDb = "MONGO_DB" // :: Internal :: ConnectingMsg = "Connecting to Mongo database" )
View Source
const (
BadgerDir = "BADGER_DIR"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerStore ¶
type BadgerStore struct {
// contains filtered or unexported fields
}
func (*BadgerStore) Delete ¶
func (b *BadgerStore) Delete(code string) int
func (*BadgerStore) IncCount ¶
func (b *BadgerStore) IncCount() int
type MongoStore ¶
type MongoStore struct {
// contains filtered or unexported fields
}
func (*MongoStore) Delete ¶
func (m *MongoStore) Delete(code string) int
func (*MongoStore) IncCount ¶
func (m *MongoStore) IncCount() int
type Store ¶
type Store interface { IncCount() int Create(code string, url string) (*models.Link, error) Read(code string) (*models.Link, error) List(limit int, skip int) []models.Link Delete(code string) int }
func NewBadgerStore ¶
func NewBadgerStore() Store
func NewMongoStore ¶
func NewMongoStore() Store
Click to show internal directories.
Click to hide internal directories.