Documentation ¶
Index ¶
- Variables
- func Delete(where ...interface{}) (result sql.Result, err error)
- func FindArray(fieldsAndWhere ...interface{}) ([]gdb.Value, error)
- func FindCount(where ...interface{}) (int, error)
- func FindValue(fieldsAndWhere ...interface{}) (gdb.Value, error)
- func Insert(data ...interface{}) (result sql.Result, err error)
- func InsertIgnore(data ...interface{}) (result sql.Result, err error)
- func Replace(data ...interface{}) (result sql.Result, err error)
- func Save(data ...interface{}) (result sql.Result, err error)
- func Update(dataAndWhere ...interface{}) (result sql.Result, err error)
- type Entity
- func (r *Entity) Delete() (result sql.Result, err error)
- func (r *Entity) Insert() (result sql.Result, err error)
- func (r *Entity) InsertIgnore() (result sql.Result, err error)
- func (r *Entity) OmitEmpty() *arModel
- func (r *Entity) Replace() (result sql.Result, err error)
- func (r *Entity) Save() (result sql.Result, err error)
- func (r *Entity) Update() (result sql.Result, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // Table is the table name of gf_user_role_route. Table = "gf_user_role_route" // Model is the model object of gf_user_role_route. Model = &arModel{g.DB("default").Table(Table).Safe()} // Columns defines and stores column names for table gf_user_role_route. Columns = struct { Id string // Name string // 权限名称 Method string // HTTP Method,可能为ALL/GET/PUT/POST/DELETE等等 Route string // 路由规则 Pattern string // 模糊路由规则的正则表达式 Brief string // 权限描述 }{ Id: "id", Name: "name", Method: "method", Route: "route", Pattern: "pattern", Brief: "brief", } )
Functions ¶
func InsertIgnore ¶
InsertIgnore is a convenience method for Model.InsertIgnore.
Types ¶
type Entity ¶
type Entity struct { Id uint `orm:"id,primary" json:"id"` // Name string `orm:"name" json:"name"` // 权限名称 Method string `orm:"method" json:"method"` // HTTP Method,可能为ALL/GET/PUT/POST/DELETE等等 Route string `orm:"route" json:"route"` // 路由规则 Pattern string `orm:"pattern" json:"pattern"` // 模糊路由规则的正则表达式 Brief string `orm:"brief" json:"brief"` // 权限描述 }
Entity is the golang structure for table gf_user_role_route.
func (*Entity) Delete ¶
Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
func (*Entity) Insert ¶
Inserts does "INSERT...INTO..." statement for inserting current object into table.
func (*Entity) InsertIgnore ¶
InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
func (*Entity) OmitEmpty ¶
func (r *Entity) OmitEmpty() *arModel
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*Entity) Replace ¶
Replace does "REPLACE...INTO..." statement for inserting current object into table. If there's already another same record in the table (it checks using primary key or unique index), it deletes it and insert this one.