Documentation ¶
Index ¶
- type FloorColumns
- type FloorDao
- func (dao *FloorDao) Columns() FloorColumns
- func (dao *FloorDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *FloorDao) DB() gdb.DB
- func (dao *FloorDao) Group() string
- func (dao *FloorDao) Table() string
- func (dao *FloorDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type LibColumns
- type LibDao
- func (dao *LibDao) Columns() LibColumns
- func (dao *LibDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *LibDao) DB() gdb.DB
- func (dao *LibDao) Group() string
- func (dao *LibDao) Table() string
- func (dao *LibDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type LocationColumns
- type LocationDao
- func (dao *LocationDao) Columns() LocationColumns
- func (dao *LocationDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *LocationDao) DB() gdb.DB
- func (dao *LocationDao) Group() string
- func (dao *LocationDao) Table() string
- func (dao *LocationDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FloorColumns ¶
type FloorColumns struct { Id string // LibId string // FloorName string // CreatedAt string // UpdatedAt string // }
FloorColumns defines and stores column names for table floor.
type FloorDao ¶
type FloorDao struct {
// contains filtered or unexported fields
}
FloorDao is the data access object for table floor.
func NewFloorDao ¶
func NewFloorDao() *FloorDao
NewFloorDao creates and returns a new DAO object for table data access.
func (*FloorDao) Columns ¶
func (dao *FloorDao) Columns() FloorColumns
Columns returns all column names of current dao.
func (*FloorDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*FloorDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*FloorDao) Transaction ¶
func (dao *FloorDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type LibColumns ¶
type LibColumns struct { Id string // LibName string // Address string // 地址 Active string // 是否正在使用 CreatedAt string // UpdatedAt string // }
LibColumns defines and stores column names for table lib.
type LibDao ¶
type LibDao struct {
// contains filtered or unexported fields
}
LibDao is the data access object for table lib.
func NewLibDao ¶
func NewLibDao() *LibDao
NewLibDao creates and returns a new DAO object for table data access.
func (*LibDao) Columns ¶
func (dao *LibDao) Columns() LibColumns
Columns returns all column names of current dao.
func (*LibDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*LibDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*LibDao) Transaction ¶
func (dao *LibDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type LocationColumns ¶
type LocationColumns struct { Id string // LibId string // FloorId string // LocationName string // CreatedAt string // UpdatedAt string // }
LocationColumns defines and stores column names for table location.
type LocationDao ¶
type LocationDao struct {
// contains filtered or unexported fields
}
LocationDao is the data access object for table location.
func NewLocationDao ¶
func NewLocationDao() *LocationDao
NewLocationDao creates and returns a new DAO object for table data access.
func (*LocationDao) Columns ¶
func (dao *LocationDao) Columns() LocationColumns
Columns returns all column names of current dao.
func (*LocationDao) Ctx ¶
func (dao *LocationDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*LocationDao) DB ¶
func (dao *LocationDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*LocationDao) Group ¶
func (dao *LocationDao) Group() string
Group returns the configuration group name of database of current dao.
func (*LocationDao) Table ¶
func (dao *LocationDao) Table() string
Table returns the table name of current dao.
func (*LocationDao) Transaction ¶
func (dao *LocationDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.