Documentation ¶
Overview ¶
Package gin input
Package gin input ¶
Package gin input ¶
Package gin input
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FullDTO ¶
type FullDTO struct { MetadataDTO ReadOnlyDTO WriteableDTO RelationshipsDTO CustomDTO } //@name user.FullDTO
FullDTO adds the framework fields id, created and updated to complete the schema. Implements user.IEntityDTO
func FromEntity ¶
func FromEntity(ety *user.UserEntity) (*FullDTO, error)
type InputGin ¶
type InputGin struct {
// contains filtered or unexported fields
}
InputGin struct to handle the clean integration with Gin Framework
func NewInputGin ¶
NewInputGin input handler constructor
func (InputGin) Create ¶
Create input controller that calls the service create function @Summary create a user @Schemes http https @Description creates an entity UserEntity @Tags users @Accept json @Produce json @Param user body PartialDTO true "The user system" @Success 200 {object} FullDTO @Failure 400 {object} api.Error @Failure 500 {object} api.Error @Router /users [post]
func (InputGin) Delete ¶
Delete input controller that calls the service delete function @Summary remove a user @Schemes http https @Description remove an entity UserEntity by Id @Tags users @Accept json @Produce json @Param id path string true "user Id" @Success 204 @Failure 404 {object} api.Error @Failure 500 {object} api.Error @Router /users/{id} [delete]
func (InputGin) Read ¶
Read input controller that calls the service read function @Summary get a user @Schemes http https @Description get an entity UserEntity by Id @Tags users @Accept json @Produce json @Param id path string true "user Id" @Success 200 {object} FullDTO @Failure 404 {object} api.Error @Failure 500 {object} api.Error @Router /users/{id} [get]
func (*InputGin) Register ¶
func (h *InputGin) Register(g gin.IRouter, middlewares ...*gin_utils.TorpedoMiddleware)
Register adds the urls binding it to service methods in the provided Gin Router
func (InputGin) TQL ¶
TQL Torpedo Query Language input controller that calls the service Query method
func (InputGin) Update ¶
Update input controller that calls the service update function @Summary update a user @Schemes http https @Description updates an entity UserEntity @Tags users @Accept json @Produce json @Param id path string true "user Id" @Param user body UpdatableDTO true "The user system" @Success 200 {object} FullDTO @Failure 400 {object} api.Error @Failure 500 {object} api.Error @Router /users/{id} [put]
type MetadataDTO ¶
type MetadataDTO struct { Id_ *string `json:"id"` Created_ *int64 `json:"created"` Updated_ *int64 `json:"updated"` } //@name user.MetadataDTO
MetadataDTO the metadata fields like id, create and update.
type PartialDTO ¶
type PartialDTO struct { ReadOnlyDTO WriteableDTO CustomDTO } //@name user.PartialDTO
PartialDTO partial data transfer object schema
type ReadOnlyDTO ¶
type ReadOnlyDTO struct {
} //@name user.ReadOnlyDTO
ReadOnlyDTO defines the read only fields
type RelationshipsDTO ¶
type UpdatableDTO ¶
type UpdatableDTO struct { WriteableDTO CustomDTO } //@name user.UpdatableDTO
UpdatableDTO accept only the writable fields (not read only)
type WriteableDTO ¶
type WriteableDTO struct { Name_ *string `json:"name,omitempty"` Email_ *string `json:"email,omitempty"` Password_ *string `json:"password,omitempty"` Plan_ *string `json:"plan,omitempty"` Miles_ *int64 `json:"miles,omitempty"` } //@name user.WriteableDTO
WriteableDTO defines the writable fields