Documentation
¶
Index ¶
- func Uint64Converter(a any) uint64
- func UintConverter(a any) uint
- type BeforeEditHook
- type BeforeFindHook
- type BeforeStoreHook
- type Controller
- func (r *Controller[M, K]) Destroy(ctx http.Context) http.Response
- func (r *Controller[M, K]) Index(ctx http.Context) http.Response
- func (r *Controller[M, K]) Show(ctx http.Context) http.Response
- func (r *Controller[M, K]) Store(ctx http.Context) http.Response
- func (r *Controller[M, K]) Update(ctx http.Context) http.Response
- type CrudRepository
- type OptionFunc
- func WithBeforeEdit[M any, K comparable](hook BeforeEditHook[M, K]) OptionFunc[M, K]
- func WithBeforeFind[M any, K comparable](hook BeforeFindHook[M]) OptionFunc[M, K]
- func WithBeforeStore[M any, K comparable](hook BeforeStoreHook[M]) OptionFunc[M, K]
- func WithRouteKey[M any, K comparable](routeKey string) OptionFunc[M, K]
- func WithScoped[M any, K comparable](filters ...base.FilterItem) OptionFunc[M, K]
- type PrimaryKeyConverter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Uint64Converter ¶
func UintConverter ¶
Types ¶
type BeforeEditHook ¶
type BeforeEditHook[M any, K comparable] func(ctx http.Context, id K, m M) (M, error)
type BeforeFindHook ¶
type Controller ¶
type Controller[M any, K comparable] struct { Repo CrudRepository[M, K] // contains filtered or unexported fields }
func NewBaseController ¶
func NewBaseController[M any, K comparable](repo CrudRepository[M, K], converter PrimaryKeyConverter[K], options ...OptionFunc[M, K]) *Controller[M, K]
type CrudRepository ¶
type OptionFunc ¶
type OptionFunc[M any, K comparable] func(controller *Controller[M, K])
func WithBeforeEdit ¶
func WithBeforeEdit[M any, K comparable](hook BeforeEditHook[M, K]) OptionFunc[M, K]
func WithBeforeFind ¶
func WithBeforeFind[M any, K comparable](hook BeforeFindHook[M]) OptionFunc[M, K]
func WithBeforeStore ¶
func WithBeforeStore[M any, K comparable](hook BeforeStoreHook[M]) OptionFunc[M, K]
func WithRouteKey ¶
func WithRouteKey[M any, K comparable](routeKey string) OptionFunc[M, K]
func WithScoped ¶
func WithScoped[M any, K comparable](filters ...base.FilterItem) OptionFunc[M, K]
type PrimaryKeyConverter ¶
type PrimaryKeyConverter[K comparable] func(any) K
Click to show internal directories.
Click to hide internal directories.