Documentation ¶
Index ¶
- Constants
- func Compress(reader io.Reader) (*bytes.Buffer, error)
- func WriteError(writer http.ResponseWriter, err error)
- type ClosableResponse
- type Request
- func (r *Request) Cookie(name string) *http.Cookie
- func (r *Request) HasCookie(name string) bool
- func (r *Request) HasPathVariable(name string) bool
- func (r *Request) HasQuery(name string) bool
- func (r *Request) Path() string
- func (r *Request) PathVariable(name string) string
- func (r *Request) QueryParam(name string) string
- func (r *Request) RelativePath() string
- type Violations
- func (v Violations) MergeCustom(custom map[string]interface{}) validator.Violations
- func (v Violations) MergeErrors(errors []*response.Error) validator.Violations
- func (v Violations) MergeGoViolation(violations []*govalidator.Violation) validator.Violations
- func (v Violations) MergeSqlViolation(violations []*sqlxvalidator.Violation) validator.Violations
Constants ¶
View Source
const ( AllowOriginHeader = "Access-Control-Allow-Origin" AllowHeadersHeader = "Access-Control-Allow-Headers" AllowMethodsHeader = "Access-Control-Allow-Methods" AllControlRequestHeader = "Access-Control-Request-Method" AllowCredentialsHeader = "Access-Control-Allow-Credentials" ExposeHeadersHeader = "Access-Control-Expose-Headers" MaxAgeHeader = "Access-Control-Max-Age" DatlyRequestMetricsHeader = "Datly-Show-Metrics" DatlyInfoHeaderValue = "info" DatlyDebugHeaderValue = "debug" DatlyRequestDisableCacheHeader = "Datly-Disable-Cache" DatlyResponseHeaderMetrics = "Datly-Metrics" DatlyServiceTimeHeader = "Datly-Service-Time" DatlyServiceInitHeader = "Datly-Service-init" //ContentTypeJSON json content type ContentTypeJSON = "application/json" CharsetUTF8 = "charset=utf-8" //EncodingGzip encoding gzip EncodingGzip = "gzip" ContentLength = "Content-Length" )
Variables ¶
This section is empty.
Functions ¶
func WriteError ¶
func WriteError(writer http.ResponseWriter, err error)
Types ¶
type ClosableResponse ¶
type ClosableResponse struct { http.ResponseWriter Closed bool }
func NewClosableResponse ¶
func NewClosableResponse(response http.ResponseWriter) *ClosableResponse
func (*ClosableResponse) WriteHeader ¶
func (c *ClosableResponse) WriteHeader(statusCode int)
type Request ¶
type Request struct { Url string `velty:"-"` QueryParams url.Values `velty:"-"` PathVariables map[string]string `velty:"-"` Headers http.Header `velty:"-"` // contains filtered or unexported fields }
func NewRequest ¶
func (*Request) HasPathVariable ¶
func (*Request) PathVariable ¶
func (*Request) QueryParam ¶
func (*Request) RelativePath ¶
type Violations ¶
func (Violations) MergeCustom ¶
func (v Violations) MergeCustom(custom map[string]interface{}) validator.Violations
func (Violations) MergeErrors ¶
func (v Violations) MergeErrors(errors []*response.Error) validator.Violations
func (Violations) MergeGoViolation ¶
func (v Violations) MergeGoViolation(violations []*govalidator.Violation) validator.Violations
func (Violations) MergeSqlViolation ¶
func (v Violations) MergeSqlViolation(violations []*sqlxvalidator.Violation) validator.Violations
Click to show internal directories.
Click to hide internal directories.