handlers

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedFields

type AllowedFields map[string][]string

func NewAllowedFields

func NewAllowedFields() AllowedFields

func (AllowedFields) Add

func (a AllowedFields) Add(from string, to ...string) AllowedFields

func (AllowedFields) AddId

func (a AllowedFields) AddId(field string) AllowedFields

func (AllowedFields) Map

func (a AllowedFields) Map(fields []string) []string

type ByFieldIds

type ByFieldIds[T any] struct {
	// contains filtered or unexported fields
}

func GetByFieldIds

func GetByFieldIds[T any](f *Factory, field string) *ByFieldIds[T]

func (*ByFieldIds[T]) ByFieldIds

func (h *ByFieldIds[T]) ByFieldIds(c *gin.Context)

func (*ByFieldIds[T]) ByFieldStringIds

func (h *ByFieldIds[T]) ByFieldStringIds(c *gin.Context)

type ById

type ById[T any] struct {
	// contains filtered or unexported fields
}

func GetByIds

func GetByIds[T any](f *Factory) *ById[T]

func (*ById[T]) ById

func (h *ById[T]) ById(c *gin.Context)

func (*ById[T]) ByIds

func (h *ById[T]) ByIds(c *gin.Context)

type ByQuery

type ByQuery[T any] struct {
	// contains filtered or unexported fields
}

func GetByQuery

func GetByQuery[T any](f *Factory, fieldsMap FieldsMap) *ByQuery[T]

func (*ByQuery[T]) ByQuery

func (b *ByQuery[T]) ByQuery(c *gin.Context)

type CreateByPost

type CreateByPost[T any] struct {
	// contains filtered or unexported fields
}

func FactoryCreateByPost

func FactoryCreateByPost[T any](h *Factory, allowedFields AllowedFields) *CreateByPost[T]

func NewCreateByPost

func NewCreateByPost[T any](db *gorm.DB, allowedFields AllowedFields) *CreateByPost[T]

func (*CreateByPost[T]) Create

func (u *CreateByPost[T]) Create(c *gin.Context)

type DbApplyFunc

type DbApplyFunc func(*gorm.DB) (*gorm.DB, error)

type DeleteById

type DeleteById[T any] struct {
	// contains filtered or unexported fields
}

func FactoryDeleteById

func FactoryDeleteById[T any](f *Factory, unscoped bool) *DeleteById[T]

func (*DeleteById[T]) Delete

func (d *DeleteById[T]) Delete(c *gin.Context)

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(db *gorm.DB) *Factory

type FieldsMap

type FieldsMap struct {
	// contains filtered or unexported fields
}

func NewFieldMap

func NewFieldMap() FieldsMap

func (FieldsMap) AddOrderFunc

func (f FieldsMap) AddOrderFunc(alias string, f1 OrderFuncFactory) FieldsMap

func (FieldsMap) AddPair

func (f FieldsMap) AddPair(alias, field string) FieldsMap

func (FieldsMap) AddSimple

func (f FieldsMap) AddSimple(field string) FieldsMap

func (FieldsMap) AddWhereFunc

func (f FieldsMap) AddWhereFunc(alias string, f1 WhereFuncFactory) FieldsMap

func (FieldsMap) AddWhereILike

func (f FieldsMap) AddWhereILike(alias string, field string) FieldsMap

func (FieldsMap) AddWhereLike

func (f FieldsMap) AddWhereLike(alias string, field string) FieldsMap

type OrderFuncFactory

type OrderFuncFactory func(bool) DbApplyFunc

type UpdateByPut

type UpdateByPut[T any] struct {
	// contains filtered or unexported fields
}

func FactoryUpdateByPut

func FactoryUpdateByPut[T any](h *Factory, allowedFields AllowedFields) *UpdateByPut[T]

func NewUpdateByPut

func NewUpdateByPut[T any](db *gorm.DB, allowedFields AllowedFields) *UpdateByPut[T]

func (*UpdateByPut[T]) Update

func (u *UpdateByPut[T]) Update(c *gin.Context)

func (*UpdateByPut[T]) UpdateByStrField

func (u *UpdateByPut[T]) UpdateByStrField(param string, search func(*gorm.DB, string, *T) error) gin.HandlerFunc

type WhereFuncFactory

type WhereFuncFactory func(value string) DbApplyFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL