Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OTP ¶
type OTP struct {
Code string `json:"code" validate:"required,numeric,len=6"`
}
OTP request that should be used inside endpoint `otp`
type Send ¶
type Send struct { Url string `form:"url" validate:"required"` Send *multipart.FileHeader `form:"send" validate:"required"` Permanent string `form:"permanent" validate:"required,boolean"` paginate.M // Order the field name to query Order. Default to id. Order string `json:"-" query:"order"` // Sort to query Order. Should be filled with either asc or desc. Default // to asc. Sort string `json:"-" query:"sort"` // Search do search for url from given string. Search string `json:"-" query:"search"` }
Send standard request object that may be used to parse request in /send.
func (*Send) PermanentToBool ¶
PermanentToBool convert Permanent field to bool.
type SendDelete ¶
type SendDelete struct {
ID uint `json:"id" validate:"required,numeric"`
}
SendDelete standard request object that may be used to parse request in /send/delete endpoint.
func (*SendDelete) Validate ¶
func (s *SendDelete) Validate() validator.ValidationErrors
Validate validation rules for SendDelete.
type SendUpdate ¶
type SendUpdate struct { ID uint `form:"id" validate:"required,numeric"` Url string `form:"url" validate:"required"` Send *multipart.FileHeader Permanent string `form:"permanent" validate:"required,boolean"` }
SendUpdate standard request object that may be used to parse request in /send/update endpoint.
func (*SendUpdate) PermanentToBool ¶
func (s *SendUpdate) PermanentToBool() bool
PermanentToBool convert Permanent field to bool.
func (*SendUpdate) Validate ¶
func (s *SendUpdate) Validate() validator.ValidationErrors
Validate validation rules for SendUpdate.
type Shorten ¶
type Shorten struct { Url string `json:"url" validate:"required"` Shorten string `json:"shorten" validate:"required,url"` Permanent string `json:"permanent" validate:"required,boolean"` paginate.M // Order the field name to query Order. Default to id. Order string `json:"-" query:"order"` // Sort to query Order. Should be filled with either asc or desc. Default // to asc. Sort string `json:"-" query:"sort"` // Search do search for url from given string. Search string `json:"-" query:"search"` }
Shorten standard request object that may be used to parse request in /shorten & /shorten/create endpoints.
func (*Shorten) PermanentToBool ¶
PermanentToBool convert Permanent field to bool.
type ShortenDelete ¶
type ShortenDelete struct {
ID uint `json:"id" validate:"required,numeric"`
}
ShortenDelete standard request object that may be used to parse request in /shorten/delete endpoint.
func (*ShortenDelete) Validate ¶
func (s *ShortenDelete) Validate() validator.ValidationErrors
Validate validation rules for ShortenDelete.
type ShortenUpdate ¶
type ShortenUpdate struct { ID uint `json:"id" validate:"required,numeric"` Url string `json:"url" validate:"required"` Shorten *string `json:"shorten" validate:"required,url"` Permanent string `json:"permanent" validate:"required,boolean"` }
ShortenUpdate standard request object that may be used to parse request in /shorten/update endpoint.
func (*ShortenUpdate) PermanentToBool ¶
func (s *ShortenUpdate) PermanentToBool() bool
PermanentToBool convert Permanent field to bool.
func (*ShortenUpdate) Validate ¶
func (s *ShortenUpdate) Validate() validator.ValidationErrors
Validate validation rules for ShortenUpdate.