Documentation ¶
Index ¶
- type Container
- type PostUserPayload
- type PutUserPayload
- type User
- type UserCrud
- func (uc *UserCrud) CreateDeleteFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter
- func (uc *UserCrud) CreateGetFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter
- func (uc *UserCrud) CreateUpdateFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter
- func (uc *UserCrud) GetBasePath() string
- func (uc *UserCrud) GetEntityEntry() interface{}
- func (uc *UserCrud) MapPostEntry(entry interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (mapped gocruddy.Entry, err error)
- func (uc *UserCrud) MapPutEntry(entry interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (mapped gocruddy.Entry, err error)
- func (uc *UserCrud) SerializeList(entries []interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (serialized interface{}, err error)
- func (uc *UserCrud) UseContainer(c gocruddy.Container)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container service container
func NewContainer ¶
func NewContainer(config []gocruddy.CrudConfig) *Container
NewContainer constructor for a new service container
func (*Container) GetCrudConfigs ¶
func (c *Container) GetCrudConfigs() []gocruddy.CrudConfig
GetCrudConfigs returns all crud configurations
func (*Container) GetCrudRepo ¶
func (c *Container) GetCrudRepo() gocruddy.CrudRepository
GetCrudRepo returns the crud repository service
func (*Container) GetDatabase ¶
GetDatabase returns the database service
type PostUserPayload ¶
type PostUserPayload struct {
Name string `json:"name"`
}
type PutUserPayload ¶
type PutUserPayload struct {
PostUserPayload
}
type UserCrud ¶
type UserCrud struct {
// contains filtered or unexported fields
}
UserCrud configuration for user crud operations
func (*UserCrud) CreateDeleteFilter ¶
func (uc *UserCrud) CreateDeleteFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter
CreateDeleteFilter restrict access for DELETE routes
func (*UserCrud) CreateGetFilter ¶
func (uc *UserCrud) CreateGetFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter
CreateGetFilter restrict access for GET routes
func (*UserCrud) CreateUpdateFilter ¶
func (uc *UserCrud) CreateUpdateFilter(ctx *fiber.Ctx) gocruddy.DatabaseFilter
CreateUpdateFilter restrict access for POST and PUT routes
func (*UserCrud) GetBasePath ¶
GetBasePath return the base path of your crud routes
func (*UserCrud) GetEntityEntry ¶
func (uc *UserCrud) GetEntityEntry() interface{}
GetEntityEntry this database entity is used for this crud
func (*UserCrud) MapPostEntry ¶
func (uc *UserCrud) MapPostEntry(entry interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (mapped gocruddy.Entry, err error)
MapPostEntry maps data from a POST request to a fresh entry instance
func (*UserCrud) MapPutEntry ¶
func (uc *UserCrud) MapPutEntry(entry interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (mapped gocruddy.Entry, err error)
MapPutEntry maps data from a PUT request to a fresh entry instance
func (*UserCrud) SerializeList ¶
func (uc *UserCrud) SerializeList(entries []interface{}, ctx *fiber.Ctx, tx *storage.Transaction) (serialized interface{}, err error)
SerializeList serialize data that is returned by the GET route
func (*UserCrud) UseContainer ¶
UseContainer register the service container