Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SQLITE represents SQLite3 SQLITE = "sqlite3" // POSTGRES represents PostgreSQL POSTGRES = "postgres" // MYSQL represents MySQL MYSQL = "mysql" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Model(value interface{}) *gorm.DB Select(query interface{}, args ...interface{}) *gorm.DB Find(out interface{}, where ...interface{}) *gorm.DB Exec(sql string, values ...interface{}) *gorm.DB First(out interface{}, where ...interface{}) *gorm.DB Raw(sql string, values ...interface{}) *gorm.DB Create(value interface{}) *gorm.DB Save(value interface{}) *gorm.DB Update(value interface{}) *gorm.DB Delete(value interface{}) *gorm.DB Where(query interface{}, args ...interface{}) *gorm.DB Preload(column string, conditions ...interface{}) *gorm.DB Scopes(funcs ...func(*gorm.DB) *gorm.DB) *gorm.DB ScanRows(rows *sql.Rows, result interface{}) error Transaction(fc func(tx Repository) error) (err error) Close() error DropTableIfExists(value interface{}) *gorm.DB AutoMigrate(value interface{}) *gorm.DB }
Repository defines a interface for access the database.
func NewBookRepository ¶
func NewBookRepository(logger *logger.Logger, conf *config.Config) Repository
NewBookRepository is constructor for bookRepository.
Click to show internal directories.
Click to hide internal directories.