Documentation ¶
Index ¶
- type IndexResponse
- type Request
- type RequestCategory
- func (r *RequestCategory) NormalizeName()
- func (p *RequestCategory) SetQuery()
- func (r *RequestCategory) Validate() validator.ValidationErrors
- func (r *RequestCategory) ValidateCreate() validator.ValidationErrors
- func (r *RequestCategory) ValidateDelete() validator.ValidationErrors
- func (r *RequestCategory) ValidateUpdate() validator.ValidationErrors
- type Response
- type ResponseCategory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexResponse ¶
IndexResponse response that's used in use case Index.
func NewIndexResponseCategoryFromEntity ¶
func NewIndexResponseCategoryFromEntity(cats []*entity.Category, prefix string) *IndexResponse[ResponseCategory]
NewIndexResponseCategoryFromEntity create new pointer IndexResponse from given slices of entity.Category. Also prepend given prefix to both Image & Icon fields after cleaning the trailing slash.
func NewIndexResponseFromEntity ¶
func NewIndexResponseFromEntity(pw []*entity.Password) *IndexResponse[Response]
NewIndexResponseFromEntity create new pointer IndexResponse from given slices of entity.Password.
type Request ¶
type Request struct { ID uint `json:"id"` Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` Category uint `json:"category" validate:"required"` // contains filtered or unexported fields }
Request standard request object that may be used in password domain.
func (*Request) Validate ¶
func (r *Request) Validate() validator.ValidationErrors
Validate apply validation rules for Request.
func (*Request) ValidateDelete ¶
func (r *Request) ValidateDelete() validator.ValidationErrors
ValidateDelete apply validation rules for RequestCategory in delete endpoint.
func (*Request) ValidateUpdate ¶
func (r *Request) ValidateUpdate() validator.ValidationErrors
ValidateUpdate apply validation rules for RequestCategory in update endpoint.
type RequestCategory ¶
type RequestCategory struct { // ID unique identifier of each Category. Should be required when updating. ID uint `form:"id"` // Name the name of category. Name string `form:"name" validate:"required"` // Image binary file for image field that should be parsed manually from // delivery. Image *multipart.FileHeader `form:"image"` // Icon binary file for icon field that should be parsed manually from // delivery. Icon *multipart.FileHeader `form:"icon"` // contains filtered or unexported fields }
RequestCategory standard request object that may be used in password domain.
func (*RequestCategory) NormalizeName ¶
func (r *RequestCategory) NormalizeName()
NormalizeName transform value of Name field to upper-cased.
func (*RequestCategory) SetQuery ¶
func (p *RequestCategory) SetQuery()
SetQuery do setup Order and Sort.
func (*RequestCategory) Validate ¶
func (r *RequestCategory) Validate() validator.ValidationErrors
Validate apply validation rules for RequestCategory.
func (*RequestCategory) ValidateCreate ¶
func (r *RequestCategory) ValidateCreate() validator.ValidationErrors
ValidateCreate apply validation rules for RequestCategory in create endpoint.
func (*RequestCategory) ValidateDelete ¶
func (r *RequestCategory) ValidateDelete() validator.ValidationErrors
ValidateDelete apply validation rules for RequestCategory in delete endpoint.
func (*RequestCategory) ValidateUpdate ¶
func (r *RequestCategory) ValidateUpdate() validator.ValidationErrors
ValidateUpdate apply validation rules for RequestCategory in update endpoint.
type Response ¶
type Response struct { ID uint `json:"id"` Username string `json:"username"` CategoryID uint `json:"category_id"` }
Response standard response object that may be used in password domain.
func NewResponseFromEntity ¶
NewResponseFromEntity transform given entity.Password to Response.
type ResponseCategory ¶
type ResponseCategory struct { ID uint `json:"id"` Name string `json:"name"` Image string `json:"image"` Icon string `json:"icon"` }
ResponseCategory standard response object that may be used in password domain.
func NewResponseCategoryFromEntity ¶
func NewResponseCategoryFromEntity(cat entity.Category, prefix string) *ResponseCategory
NewResponseCategoryFromEntity transform given entity.Category to ResponseCategory. Also prepend given prefix to both Image & Icon fields after cleaning the trailing slash.