Documentation ¶
Index ¶
- type Controller
- type Impl
- func (i Impl) All() (res []interface{}, err error)
- func (i Impl) Count() (int64, error)
- func (i Impl) Create(data map[string]interface{}) (err error)
- func (i Impl) CreateIfNotExist(data map[string]interface{}, primaryKeys []string) (err error)
- func (i Impl) CreateOrUpdate(data map[string]interface{}, primaryKeys []string, updateFields []string) (obj interface{}, created bool, err error)
- func (i Impl) CreateOrUpdateByModel(primaryKeys []string, updateFields []string) (obj interface{}, created bool, err error)
- func (i Impl) Delete(data map[string]interface{}) (err error)
- func (i Impl) Exist() (bool, error)
- func (i Impl) Filter(filter map[string]interface{}) Controller
- func (i Impl) Get() (interface{}, error)
- func (i Impl) GetC2CMap(column1, column2 string) (res map[string]string, err error)
- func (i Impl) GetID2KeyMap(key string) (res map[int64]string, err error)
- func (i Impl) GetID2Map() (res map[int64]map[string]interface{}, err error)
- func (i Impl) GetKey2IDMap(key string) (res map[string]int64, err error)
- func (i Impl) Limit(pageSize, pageNum int) Controller
- func (i Impl) List() (total int64, res []map[string]interface{}, err error)
- func (i Impl) Model() interface{}
- func (i Impl) OrderBy(orderBy string) Controller
- func (i Impl) SetModel(model interface{}) Controller
- func (i Impl) Update(data map[string]interface{}, primaryKeys []string, updateFields []string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { Model() interface{} SetModel(interface{}) Controller Filter(filter map[string]interface{}) Controller OrderBy(orderBy string) Controller Limit(pageSize, pageNum int) Controller Count() (int64, error) Exist() (bool, error) Get() (interface{}, error) All() ([]interface{}, error) List() (int64, []map[string]interface{}, error) Create(map[string]interface{}) error Update(map[string]interface{}, []string, []string) error Delete(map[string]interface{}) error CreateIfNotExist(map[string]interface{}, []string) error CreateOrUpdate(map[string]interface{}, []string, []string) (interface{}, bool, error) CreateOrUpdateByModel([]string, []string) (interface{}, bool, error) GetC2CMap(string, string) (map[string]string, error) GetKey2IDMap(string) (map[string]int64, error) GetID2KeyMap(string) (map[int64]string, error) GetID2Map() (map[int64]map[string]interface{}, error) }
func NewCtl ¶
func NewCtl(model interface{}) Controller
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (Impl) CreateIfNotExist ¶
func (Impl) CreateOrUpdate ¶
func (Impl) CreateOrUpdateByModel ¶
func (Impl) Filter ¶
func (i Impl) Filter(filter map[string]interface{}) Controller
func (Impl) Limit ¶
func (i Impl) Limit(pageSize, pageNum int) Controller
func (Impl) OrderBy ¶
func (i Impl) OrderBy(orderBy string) Controller
func (Impl) SetModel ¶
func (i Impl) SetModel(model interface{}) Controller
Click to show internal directories.
Click to hide internal directories.