Documentation ¶
Index ¶
- type Controller
- func (c *Controller[CONN, ID, DATA]) DeleteOne(filter map[string]interface{}, provider *store.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error)
- func (c *Controller[CONN, ID, DATA]) EraseOne(filter map[string]interface{}, provider *store.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error)
- func (c *Controller[CONN, ID, DATA]) Find(filter map[string]interface{}, page *abstract.Page, ...) (recordset.RecordSet[ID, DATA], error)
- func (c *Controller[CONN, ID, DATA]) FindOne(identifier ID, deleted bool, other_filters *map[string]interface{}, ...) (record.Record[ID, DATA], error)
- func (c *Controller[CONN, ID, DATA]) FindOneByFilter(filter map[string]interface{}, ...) (record.Record[ID, DATA], error)
- func (c *Controller[CONN, ID, DATA]) GetField(key string) string
- func (c *Controller[CONN, ID, DATA]) GetTimeNow() primitive.Timestamp
- func (c *Controller[CONN, ID, DATA]) GetValidator() *validator.Validate
- func (c Controller[CONN, ID, DATA]) InsertOne(data DATA, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error)
- func (c *Controller[CONN, ID, DATA]) UpdateOne(filter map[string]interface{}, update DATA, ...) (record.Record[ID, DATA], error)
- type IController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller[CONN any, ID any, DATA any] struct { Validator *validator.Validate Fields map[string]string }
func (*Controller[CONN, ID, DATA]) DeleteOne ¶
func (c *Controller[CONN, ID, DATA]) DeleteOne( filter map[string]interface{}, provider *store.StoreProvider[CONN, ID, DATA], ) (record.Record[ID, DATA], error)
Метод мягкого удаления
func (*Controller[CONN, ID, DATA]) EraseOne ¶
func (c *Controller[CONN, ID, DATA]) EraseOne( filter map[string]interface{}, provider *store.StoreProvider[CONN, ID, DATA], ) (record.Record[ID, DATA], error)
Метод перманентного удаления
func (*Controller[CONN, ID, DATA]) Find ¶
func (c *Controller[CONN, ID, DATA]) Find( filter map[string]interface{}, page *abstract.Page, provider *store_provider.StoreProvider[CONN, ID, DATA], ) (recordset.RecordSet[ID, DATA], error)
Метод получения списка записей по фильтрам и пагинации
func (*Controller[CONN, ID, DATA]) FindOne ¶
func (c *Controller[CONN, ID, DATA]) FindOne( identifier ID, deleted bool, other_filters *map[string]interface{}, provider *store_provider.StoreProvider[CONN, ID, DATA], ) (record.Record[ID, DATA], error)
Метод получения одной записи по фильтрам
func (*Controller[CONN, ID, DATA]) FindOneByFilter ¶
func (c *Controller[CONN, ID, DATA]) FindOneByFilter( filter map[string]interface{}, provider *store_provider.StoreProvider[CONN, ID, DATA], ) (record.Record[ID, DATA], error)
Метод получения одной записи по фильтрам
func (*Controller[CONN, ID, DATA]) GetField ¶
func (c *Controller[CONN, ID, DATA]) GetField(key string) string
func (*Controller[CONN, ID, DATA]) GetTimeNow ¶
func (c *Controller[CONN, ID, DATA]) GetTimeNow() primitive.Timestamp
Метод получения текущей даты в формате Timestamp
func (*Controller[CONN, ID, DATA]) GetValidator ¶
func (c *Controller[CONN, ID, DATA]) GetValidator() *validator.Validate
func (Controller[CONN, ID, DATA]) InsertOne ¶
func (c Controller[CONN, ID, DATA]) InsertOne( data DATA, provider *store_provider.StoreProvider[CONN, ID, DATA], ) (record.Record[ID, DATA], error)
Метод создания записи
func (*Controller[CONN, ID, DATA]) UpdateOne ¶
func (c *Controller[CONN, ID, DATA]) UpdateOne( filter map[string]interface{}, update DATA, provider *store_provider.StoreProvider[CONN, ID, DATA], ) (record.Record[ID, DATA], error)
Метод обновления одной записи
type IController ¶
type IController[CONN any, ID any, DATA any] interface { InsertOne(data DATA, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error) FindOne(identifier ID, deleted bool, other_filters *map[string]interface{}, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error) FindOneByFilter(filter map[string]interface{}, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error) Find(filter map[string]interface{}, page *abstract.Page, provider *store_provider.StoreProvider[CONN, ID, DATA]) (recordset.RecordSet[ID, DATA], error) UpdateOne(filter map[string]interface{}, update DATA, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error) DeleteOne(filter map[string]interface{}, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error) EraseOne(filter map[string]interface{}, provider *store_provider.StoreProvider[CONN, ID, DATA]) (record.Record[ID, DATA], error) GetTimeNow() primitive.Timestamp GetValidator() *validator.Validate GetField(keys string) string }
Click to show internal directories.
Click to hide internal directories.