Documentation ¶
Index ¶
- func NewDatabase(c Config) *gorm.DB
- type CollectionQuery
- type Config
- type DefaultRepositoryNotSetErr
- type Direction
- type Filter
- type FilterQuery
- type FilteredQueryObject
- type JSON
- type Preload
- type Query
- func (q *Query) AddPreload(preload Preload)
- func (q *Query) Error() error
- func (q *Query) Model() interface{}
- func (q *Query) Preloads() []Preload
- func (q *Query) Result() interface{}
- func (q *Query) SetError(err error)
- func (q *Query) SetModel(model interface{})
- func (q *Query) SetPreloads(preloads *[]Preload)
- func (q *Query) SetResult(result interface{})
- func (q *Query) Type() string
- type QueryHandler
- type QueryManager
- type QueryObject
- type Repository
- type RepositoryNotFoundErr
- type Slice
- type SlicedQueryObject
- type Sort
- type UnsupportedQueryTypeErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabase ¶
Types ¶
type CollectionQuery ¶
type CollectionQuery struct { FilterQuery // contains filtered or unexported fields }
func NewCollectionQuery ¶
func NewCollectionQuery(model interface{}) *CollectionQuery
func (*CollectionQuery) SetSlice ¶
func (q *CollectionQuery) SetSlice(slice *Slice)
func (*CollectionQuery) Slice ¶
func (q *CollectionQuery) Slice() *Slice
type DefaultRepositoryNotSetErr ¶
type DefaultRepositoryNotSetErr struct { }
func NewDefaultRepositoryNotSetErr ¶
func NewDefaultRepositoryNotSetErr() DefaultRepositoryNotSetErr
func (DefaultRepositoryNotSetErr) Error ¶
func (e DefaultRepositoryNotSetErr) Error() string
type FilterQuery ¶
type FilterQuery struct { Query // contains filtered or unexported fields }
func NewFilterQuery ¶
func NewFilterQuery(model interface{}) *FilterQuery
func (*FilterQuery) Filters ¶
func (q *FilterQuery) Filters() []Filter
func (*FilterQuery) SetFilters ¶
func (q *FilterQuery) SetFilters(filters []Filter)
type FilteredQueryObject ¶
type FilteredQueryObject interface { QueryObject Filters() []Filter }
type JSON ¶
type JSON json.RawMessage
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) AddPreload ¶
func (*Query) SetPreloads ¶
type QueryHandler ¶
type QueryHandler struct {
// contains filtered or unexported fields
}
func NewQueryHandler ¶
func NewQueryHandler(db *gorm.DB) *QueryHandler
func (*QueryHandler) Handle ¶
func (h *QueryHandler) Handle(query QueryObject) QueryObject
func (*QueryHandler) Supports ¶
func (h *QueryHandler) Supports(t interface{}) bool
type QueryManager ¶
type QueryManager struct {
// contains filtered or unexported fields
}
func NewQueryManager ¶
func NewQueryManager(db *gorm.DB) *QueryManager
func (*QueryManager) DB ¶
func (m *QueryManager) DB() *gorm.DB
func (*QueryManager) Default ¶
func (m *QueryManager) Default() (Repository, error)
func (*QueryManager) Get ¶
func (m *QueryManager) Get(t interface{}) (Repository, error)
func (*QueryManager) Register ¶
func (m *QueryManager) Register(r Repository)
type QueryObject ¶
type Repository ¶
type Repository interface { Handle(q QueryObject) QueryObject Supports(t interface{}) bool }
type RepositoryNotFoundErr ¶
type RepositoryNotFoundErr struct {
// contains filtered or unexported fields
}
func NewRepositoryNotFound ¶
func NewRepositoryNotFound(t interface{}) RepositoryNotFoundErr
func (RepositoryNotFoundErr) Error ¶
func (e RepositoryNotFoundErr) Error() string
type SlicedQueryObject ¶
type SlicedQueryObject interface { FilteredQueryObject Slice() *Slice }
type UnsupportedQueryTypeErr ¶
type UnsupportedQueryTypeErr struct {
// contains filtered or unexported fields
}
func (UnsupportedQueryTypeErr) Error ¶
func (e UnsupportedQueryTypeErr) Error() string
Click to show internal directories.
Click to hide internal directories.