Documentation ¶
Overview ¶
Package db implements database interactions.
Package db implements database interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Store(logModel *models.LogModel) (string, error) Update(id string, logModel models.LogModel) error Delete(id string) error Drop() error Close() }
Repository is a contract for databases
func Connect ¶
func Connect(dbType StorageType, params Params) (Repository, error)
Connect establish connection to passed database type
type StorageType ¶
type StorageType uint
StorageType is a storage type.
const (
// StorageTypeMongo - mongo mongoDB type
StorageTypeMongo StorageType
)
func (StorageType) String ¶
func (i StorageType) String() string
func (StorageType) Valid ¶
func (i StorageType) Valid() bool
Valid checks if storage type is in a valid value range.
Click to show internal directories.
Click to hide internal directories.