All Downloads are FREE. Search and download functionalities are using the official Maven repository.

go-server.helpers.mustache Maven / Gradle / Ivy

{{>partial_header}}
package {{packageName}}

//Response return a ImplResponse struct filled
func Response(code int, body interface{}) ImplResponse {
	return ImplResponse {
		Code: code,
		{{#addResponseHeaders}}
		Headers: nil,
		{{/addResponseHeaders}}
		Body: body,
	}
}
{{#addResponseHeaders}}

//ResponseWithHeaders return a ImplResponse struct filled, including headers
func ResponseWithHeaders(code int, headers map[string][]string, body interface{}) ImplResponse {
	return ImplResponse {
		Code: code,
		Headers: headers,
		Body: body,
	}
}
{{/addResponseHeaders}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy