Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
type IDData struct {
ID string `json:"id" binding:"required"`
Type string `json:"type" binding:"required"` // this value should be buzz or fizz only
}
type request struct {
IDS []IDData `json:"ids" binding:"required,dive"`
Timespan int64 `json:"timespan" binding:"required"`
}
I need to validate the type value of IDData struct to be only buzz or fizz else throw error.
Is there any validator for this case.
I have a use case like this
I need to validate the
type
value of IDData struct to be onlybuzz
orfizz
else throw error. Is there any validator for this case.