Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DAOInterface ¶
type DAOInterface interface { // FindByFilter is the global function to get multiple results from the database, with custom filters and pagination. FindByFilter(dest interface{}, ff []FilterFunc, pf *PaginationFilter) (DAOResultsInterface, error) // FindBy is the shortcut function of FindByFilter with simple filters FindBy(dest interface{}, params map[string]string, pf *PaginationFilter) (DAOResultsInterface, error) // FindById is the function to get a single result by its ID FindById(dest interface{}, id string) (DAOResultInterface, error) // UpdateFromPrevious is the function to update a resource from a previous resource UpdateFromPrevious(from interface{}, to interface{}) (DAOResultInterface, error) // Create is the function to create a resource Create(resource interface{}) (DAOResultInterface, error) // DeleteById is the function to delete a resource by its id DeleteById(resource interface{}, id string) error }
DAOInterface is is the interface to implement if you need to have a custom database manager, by default you can use the dao in orm folder.
func GetResourceDAO ¶
func GetResourceDAO(resource interface{}) DAOInterface
Get the DAO of a resource, or the default one if no one is configured
type DAOResultInterface ¶
type DAOResultInterface interface {
Get() S
}
Interface to get a DAOResultInterface
type DAOResultsInterface ¶
Interface to get a DAOResultsInterface
type FilterFunc ¶
Type function to create to handle filters, it starts from a Statement and returns the same updated Statement
type GetDAOInterface ¶
type GetDAOInterface interface {
GetDAO() DAOInterface
}
Interface to implement in the resource when you want to use a custom DAO
type PaginationFilter ¶
Pagination filter is a model to use to handle pagination results
Click to show internal directories.
Click to hide internal directories.