Documentation
¶
Index ¶
- Variables
- func Init(eng storage.Engine)
- type Address
- type AddressMeta
- type AddressSlice
- type AddressView
- type AddressViewSlice
- type Product
- type ProductMeta
- type ProductPriceIndex
- func (ProductPriceIndex) Name() string
- func (index ProductPriceIndex) Remove(session storage.Session, keys ...interface{}) error
- func (ProductPriceIndex) TableMeta() storage.TableMeta
- func (index ProductPriceIndex) Update(session storage.Session, table storage.ReadonlyTable, key interface{}, ...) error
- type ProductSlice
- type ProductView
- type ProductViewSlice
- type User
- type UserAddrIndex
- type UserAgeIndex
- type UserMeta
- type UserSlice
- type UserView
- type UserViewSlice
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AddressViewVar = AddressView{}
)
View Source
var ProductPriceIndexVar = ProductPriceIndex{}
View Source
var (
ProductViewVar = ProductView{}
)
View Source
var UserAddrIndexVar = UserAddrIndex{}
View Source
var UserAgeIndexVar = UserAgeIndex{}
View Source
var (
UserViewVar = UserView{}
)
Functions ¶
Types ¶
type Address ¶
type Address struct {
Id int64 `xorm:"pk BIGINT(20) autoincr" json:"id"`
Addr string `xorm:"VARCHAR(1024) not null" json:"addr"`
}
func NewAddress ¶
func NewAddress() *Address
func (Address) Meta ¶
func (Address) Meta() AddressMeta
type AddressMeta ¶
type AddressMeta struct {
F_addr string
}
Meta
func (AddressMeta) Fields ¶
func (AddressMeta) Fields() []string
func (AddressMeta) Key ¶
func (AddressMeta) Key() string
func (AddressMeta) Name ¶
func (AddressMeta) Name() string
type AddressSlice ¶
type AddressSlice []Address
Slice
func NewAddressSlice ¶
func NewAddressSlice(cap int) *AddressSlice
func (AddressSlice) Len ¶
func (s AddressSlice) Len() int
func (*AddressSlice) Slice ¶
func (s *AddressSlice) Slice() []Address
func (AddressSlice) TableMeta ¶
func (s AddressSlice) TableMeta() storage.TableMeta
type AddressView ¶
type AddressView struct {
Address
}
View
func (AddressView) Fields ¶
func (AddressView) Fields() storage.FieldList
func (AddressView) TableMeta ¶
func (AddressView) TableMeta() storage.TableMeta
type AddressViewSlice ¶
type AddressViewSlice []AddressView
func NewAddressViewSlice ¶
func NewAddressViewSlice(cap int) *AddressViewSlice
func (AddressViewSlice) Len ¶
func (s AddressViewSlice) Len() int
func (*AddressViewSlice) Slice ¶
func (s *AddressViewSlice) Slice() []AddressView
func (AddressViewSlice) TableMeta ¶
func (s AddressViewSlice) TableMeta() storage.TableMeta
type Product ¶
type Product struct {
Id int64 `xorm:"pk BIGINT(20) autoincr" json:"id"`
Price int32 `xorm:"INT(10) not null DEFAULT 1" json:"price"`
Name string `xorm:"VARCHAR(256) not null" json:"name"`
Image string `xorm:"VARCHAR(512) not null" json:"image"`
Desc string `xorm:"VARCHAR(1024) not null DEFAULT 'hello'" json:"desc"`
}
func NewProduct ¶
func NewProduct() *Product
func (Product) Meta ¶
func (Product) Meta() ProductMeta
type ProductMeta ¶
Meta
func (ProductMeta) Fields ¶
func (ProductMeta) Fields() []string
func (ProductMeta) Key ¶
func (ProductMeta) Key() string
func (ProductMeta) Name ¶
func (ProductMeta) Name() string
type ProductPriceIndex ¶
type ProductPriceIndex struct{}
Index
func (ProductPriceIndex) Name ¶
func (ProductPriceIndex) Name() string
func (ProductPriceIndex) Remove ¶
func (index ProductPriceIndex) Remove(session storage.Session, keys ...interface{}) error
func (ProductPriceIndex) TableMeta ¶
func (ProductPriceIndex) TableMeta() storage.TableMeta
func (ProductPriceIndex) Update ¶
func (index ProductPriceIndex) Update(session storage.Session, table storage.ReadonlyTable, key interface{}, updatedFields []string) error
type ProductSlice ¶
type ProductSlice []Product
Slice
func NewProductSlice ¶
func NewProductSlice(cap int) *ProductSlice
func (ProductSlice) Len ¶
func (s ProductSlice) Len() int
func (*ProductSlice) Slice ¶
func (s *ProductSlice) Slice() []Product
func (ProductSlice) TableMeta ¶
func (s ProductSlice) TableMeta() storage.TableMeta
type ProductView ¶
type ProductView struct {
Product
}
View
func (ProductView) Fields ¶
func (ProductView) Fields() storage.FieldList
func (ProductView) TableMeta ¶
func (ProductView) TableMeta() storage.TableMeta
type ProductViewSlice ¶
type ProductViewSlice []ProductView
func NewProductViewSlice ¶
func NewProductViewSlice(cap int) *ProductViewSlice
func (ProductViewSlice) Len ¶
func (s ProductViewSlice) Len() int
func (*ProductViewSlice) Slice ¶
func (s *ProductViewSlice) Slice() []ProductView
func (ProductViewSlice) TableMeta ¶
func (s ProductViewSlice) TableMeta() storage.TableMeta
type User ¶
type User struct {
Id int64 `xorm:"pk BIGINT(20)" json:"id"`
Name string `xorm:"VARCHAR(64) not null DEFAULT ''" json:"name"`
Age int `xorm:"BIGINT(20)" json:"age"`
AddrId int64 `xorm:"BIGINT(20)" json:"addr_id"`
ProductId int64 `xorm:"BIGINT(20)" json:"product_id"`
IsRobot bool `xorm:"TINYINT(1) DEFAULT false" json:"is_robot"`
}
type UserAddrIndex ¶
type UserAddrIndex struct{}
Index
func (UserAddrIndex) Name ¶
func (UserAddrIndex) Name() string
func (UserAddrIndex) Remove ¶
func (index UserAddrIndex) Remove(session storage.Session, keys ...interface{}) error
func (UserAddrIndex) TableMeta ¶
func (UserAddrIndex) TableMeta() storage.TableMeta
func (UserAddrIndex) Update ¶
func (index UserAddrIndex) Update(session storage.Session, table storage.ReadonlyTable, key interface{}, updatedFields []string) error
type UserAgeIndex ¶
type UserAgeIndex struct{}
Index
func (UserAgeIndex) Name ¶
func (UserAgeIndex) Name() string
func (UserAgeIndex) Remove ¶
func (index UserAgeIndex) Remove(session storage.Session, keys ...interface{}) error
func (UserAgeIndex) TableMeta ¶
func (UserAgeIndex) TableMeta() storage.TableMeta
func (UserAgeIndex) Update ¶
func (index UserAgeIndex) Update(session storage.Session, table storage.ReadonlyTable, key interface{}, updatedFields []string) error
type UserMeta ¶
type UserMeta struct {
F_name string
F_age string
F_addr_id string
F_product_id string
F_is_robot string
}
Meta
type UserViewSlice ¶
type UserViewSlice []UserView
func NewUserViewSlice ¶
func NewUserViewSlice(cap int) *UserViewSlice
func (UserViewSlice) Len ¶
func (s UserViewSlice) Len() int
func (*UserViewSlice) Slice ¶
func (s *UserViewSlice) Slice() []UserView
func (UserViewSlice) TableMeta ¶
func (s UserViewSlice) TableMeta() storage.TableMeta
Click to show internal directories.
Click to hide internal directories.