Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConvertToModel ¶ added in v0.0.8
type ConvertToModel[T any] interface { ToModel() T }
type FilterField ¶
type FilterField struct { Field string Type FilterType Value any }
func (FilterField) Condition ¶
func (f FilterField) Condition() string
func (FilterField) Values ¶
func (f FilterField) Values() []any
type FilterType ¶
type FilterType string
const ( EQ FilterType = "=" NE FilterType = "!=" GE FilterType = ">=" GT FilterType = ">" LE FilterType = "<=" LT FilterType = "<" LIKE FilterType = "LIKE" IN FilterType = "IN" NOTIN FilterType = "NOT IN" BETWEEN FilterType = "BETWEEN" )
func (FilterType) ToCondition ¶ added in v0.0.7
func (f FilterType) ToCondition() string
type GormFilter ¶
type GormRepository ¶ added in v0.0.8
type GormRepository[T RepositoryItem] interface { Conn() *gorm.DB New() T NewSlice() []T GetByID(id int64) (T, error) GetByIDs(ids ...int64) ([]T, error) GetResults(filters ...GormFilter) ([]T, error) ApplyFilters(filters ...GormFilter) (*gorm.DB, error) Count(filters ...GormFilter) (int64, error) Create(T) (T, error) Update(T) (bool, error) Delete(T) (bool, error) }
type NotFilterableError ¶ added in v0.0.10
type NotFilterableError struct {
Field string
}
func (NotFilterableError) Error ¶ added in v0.0.10
func (e NotFilterableError) Error() string
type PageFilter ¶
func (PageFilter) Condition ¶
func (p PageFilter) Condition() string
func (PageFilter) Values ¶
func (p PageFilter) Values() []any
type RepositoryItem ¶ added in v0.0.8
type WhereFilter ¶
type WhereFilter []any
func (WhereFilter) Condition ¶
func (w WhereFilter) Condition() string
func (WhereFilter) Values ¶
func (w WhereFilter) Values() []any
Click to show internal directories.
Click to hide internal directories.