Documentation ¶
Index ¶
- func NewController[Type Resource](name string, opts ...Option[Type]) app.Controller
- type Controller
- func (resource *Controller[Type]) BasePath() string
- func (resource *Controller[Type]) CreateOne()
- func (resource *Controller[Type]) DeleteOne()
- func (resource *Controller[Type]) FindAll()
- func (resource *Controller[Type]) FindOne()
- func (resource *Controller[Type]) Mx(mapper *app.Mapper)
- func (resource *Controller[Type]) ReplaceOne()
- func (resource *Controller[Type]) UpdateOne()
- type Option
- func WithCreateOneFilters[Type Resource](filters ...request.Handler) Option[Type]
- func WithDeleteOneFilters[Type Resource](filters ...request.Handler) Option[Type]
- func WithFindAllFilters[Type Resource](filters ...request.Handler) Option[Type]
- func WithFindOneFilters[Type Resource](filters ...request.Handler) Option[Type]
- func WithPerPageLimit[Type Resource](perPage int) Option[Type]
- func WithReplaceOneFilters[Type Resource](filters ...request.Handler) Option[Type]
- func WithUpdateOneFilters[Type Resource](filters ...request.Handler) Option[Type]
- type Resource
- type SearchContext
- type SortField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewController ¶
func NewController[Type Resource](name string, opts ...Option[Type]) app.Controller
Types ¶
type Controller ¶
type Controller[Type Resource] struct { Controller Type *request.Context // contains filtered or unexported fields }
func (*Controller[Type]) BasePath ¶
func (resource *Controller[Type]) BasePath() string
func (*Controller[Type]) CreateOne ¶
func (resource *Controller[Type]) CreateOne()
func (*Controller[Type]) DeleteOne ¶
func (resource *Controller[Type]) DeleteOne()
func (*Controller[Type]) FindAll ¶
func (resource *Controller[Type]) FindAll()
func (*Controller[Type]) FindOne ¶
func (resource *Controller[Type]) FindOne()
func (*Controller[Type]) Mx ¶
func (resource *Controller[Type]) Mx(mapper *app.Mapper)
func (*Controller[Type]) ReplaceOne ¶
func (resource *Controller[Type]) ReplaceOne()
func (*Controller[Type]) UpdateOne ¶
func (resource *Controller[Type]) UpdateOne()
type Option ¶
type Option[Type Resource] func(resource *Controller[Type])
func WithCreateOneFilters ¶
func WithDeleteOneFilters ¶
func WithFindAllFilters ¶
func WithFindOneFilters ¶
func WithPerPageLimit ¶
func WithReplaceOneFilters ¶
type Resource ¶
type Resource interface { FindAllModel() any FindOneModel() any FindUpdateModel() any Model() any UpdateOneModel() any FindAll(pageData SearchContext) (any, int, validation.Result, error) FindOne(resourceId string) (any, validation.Result, error) CreateOne() (validation.Result, error) UpdateOne(resourceId string) (validation.Result, error) DeleteOne(resourceId string) (validation.Result, error) ReplaceOne(resourceId string) (validation.Result, error) }
type SearchContext ¶
Click to show internal directories.
Click to hide internal directories.