Documentation ¶
Index ¶
- Constants
- Variables
- func DasParseHtmlInputDate(input string) time.Time
- func DasParseHtmlInputDateTime(input string) time.Time
- func ParseRequestBodyData(r *http.Request, dto interface{}) error
- func ParseRequestData(r *http.Request, dto interface{}) error
- func RespondJsonResult(w http.ResponseWriter, status int, message string, data interface{})
- type DasController
- type DasControllerGroup
Constants ¶
View Source
const ( // HTTP400InvalidRequestData provides a generic message that can be used when HTTP 400 error has to be returned HTTP400InvalidRequestData = "invalid request data" Http404NoDataFound = "no data is found" // HTTP500ErrorRetrievingData provides a generic error message which indicates that data access layer code has thrown an error HTTP500ErrorRetrievingData = "error in retrieving data" )
Variables ¶
View Source
var JsonRequestDecoder = schema.NewDecoder()
Functions ¶
func DasParseHtmlInputDate ¶
func ParseRequestBodyData ¶
func ParseRequestData ¶
func RespondJsonResult ¶
func RespondJsonResult(w http.ResponseWriter, status int, message string, data interface{})
Types ¶
type DasController ¶
type DasController struct { Name string Description string Method string Endpoint string Handler http.HandlerFunc AllowedRoles []int }
DasController specifies the description, allowed method, endpoint, handler functions, and roles allowed to access this controller. Controller does not specifies the underlying source of data that it depends on. Instead, create a separate sever for each particular controller, specify the data source inside the server struct and inject data source into controller's HandlerFunc implementation.
type DasControllerGroup ¶
type DasControllerGroup struct {
Controllers []DasController
}
Click to show internal directories.
Click to hide internal directories.