Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shortener ¶
type Shortener interface { Get(id string) (entities.Shorten, error) Insert(srt entities.Shorten) error Update(srt entities.Shorten) error }
Shortener is interface for methods the store package.
type StoreMongodb ¶
type StoreMongodb struct {
// contains filtered or unexported fields
}
StoreMongodb is struct for db mongodb
func NewStoreMongodb ¶
func NewStoreMongodb() *StoreMongodb
NewStoreMongodb return instance the StoreMongodb
func (*StoreMongodb) Disconnect ¶
func (sm *StoreMongodb) Disconnect() error
Disconnect execute disconnect for database.
func (*StoreMongodb) Get ¶
func (sm *StoreMongodb) Get(id string) (entities.Shorten, error)
Get return first Shorten from database
func (*StoreMongodb) Insert ¶
func (sm *StoreMongodb) Insert(srt entities.Shorten) error
Insert add new Shorten to database
func (*StoreMongodb) Ping ¶
func (sm *StoreMongodb) Ping() error
Ping execute test of connection in database.
type StoreSqlite ¶
type StoreSqlite struct {
// contains filtered or unexported fields
}
StoreSqlite is struct for db sqlite.
func NewStoreSqlite ¶
func NewStoreSqlite() *StoreSqlite
NewStoreSqlite return instance the StoreSqlite.
func (*StoreSqlite) Get ¶
func (s *StoreSqlite) Get(id string) (entities.Shorten, error)
Get return first Shorten from database.
Click to show internal directories.
Click to hide internal directories.