Documentation
¶
Index ¶
- Variables
- type Error
- func (e *Error) BodyLength() int
- func (e *Error) Err() error
- func (e *Error) Error() string
- func (e *Error) ErrorCode(code string) *Error
- func (e *Error) Format(msg string, args ...interface{}) *Error
- func (e *Error) FormatFunc(msg string) func(args ...interface{}) *Error
- func (e *Error) Header() http.Header
- func (e *Error) Reason(args ...interface{}) *Error
- func (e *Error) Scan(src interface{}) error
- func (e *Error) Status(status int) *Error
- func (e *Error) StatusCode() int
- func (e *Error) String() string
- func (*Error) Validate(formats strfmt.Registry) error
- func (e Error) Value() (driver.Value, error)
- func (e *Error) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
- type JSONMap
- func (p JSONMap) Bool(key string, def ...bool) bool
- func (p JSONMap) Copy() JSONMap
- func (p JSONMap) Delete(key string)
- func (p JSONMap) Float64(key string, def ...float64) float64
- func (p JSONMap) Get(key string, def ...interface{}) (interface{}, bool)
- func (p JSONMap) Int64(key string, def ...int64) int64
- func (p JSONMap) IsSet(key string) bool
- func (p JSONMap) IsSetV(key string) (Value, bool)
- func (p *JSONMap) Scan(src interface{}) error
- func (p JSONMap) Set(key string, value interface{})
- func (p JSONMap) String(key string, def ...string) string
- func (p JSONMap) StringPtr(key string, def ...string) *string
- func (p JSONMap) StringSlice(key string) []string
- func (p JSONMap) Sub(key string) JSONMap
- func (*JSONMap) Validate(formats strfmt.Registry) error
- func (p JSONMap) Value() (driver.Value, error)
- func (p JSONMap) Without(keys ...string) JSONMap
- type Link
- type Model
- type Params
- type Response
- func (r *Response) Body() []byte
- func (r *Response) Copy() *Response
- func (r *Response) Header() http.Header
- func (r *Response) Length() int
- func (r *Response) SetAcceleration(acc bool) *Response
- func (r *Response) SetHeader(name, value string) *Response
- func (r *Response) SetHeaderMap(vals map[string]string) *Response
- func (r *Response) SetHeaders(h http.Header) *Response
- func (r *Response) SetOptions(options ...*ResponseOptions) *Response
- func (r *Response) SetPayload(payload interface{}) *Response
- func (r *Response) SetStatus(s int) *Response
- func (r *Response) StatusCode() int
- func (r *Response) Write(body []byte) (int, error)
- func (r *Response) WriteHeader(statusCode int)
- func (r *Response) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
- type ResponseOptions
- type StringArray
- type StringMap
- type UUIDArray
- type Value
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotAuthorized defines a not authorized error ErrNotAuthorized = NewError().Status(http.StatusUnauthorized).Format("not authorized") // ErrInvalidParameter defines an invalid parameter error ErrInvalidParameter = NewError().Status(http.StatusBadRequest).Format("invalid parameter") // ErrNotImplemented defines a not implemented error ErrNotImplemented = NewError().Status(http.StatusNotImplemented).FormatFunc("method '%s' not implemented") // ErrResourceConflict is returned when an object conflicts with one that already exists ErrResourceConflict = NewError().Status(http.StatusConflict).FormatFunc("'%s' conflicts with one that already exists") // ErrNotFound is is returned when an object was not found ErrNotFound = NewError().Status(http.StatusNotFound).FormatFunc("'%s' not found") // ErrServerError is reserved for server errors ErrServerError = NewError().Status(http.StatusInternalServerError).FormatFunc("server error: %s") )
var ( // NoContentResponse is a no content HTTP success response NoContentResponse = NewResponse().SetStatus(http.StatusNoContent) // SeeOtherResponse returns a redirect response SeeOtherResponse = func(loc string) *Response { return NewResponse().SetStatus(http.StatusSeeOther).SetHeader("Location", loc) } )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Detail map[string]string `json:"detail,omitempty"`
// contains filtered or unexported fields
}
Error is the common error struct compatible with swagger response types
func (*Error) BodyLength ¶
BodyLength returns the http body length in bytes
func (*Error) FormatFunc ¶
FormatFunc func formats a error message functor
func (*Error) WriteResponse ¶
func (e *Error) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
WriteResponse implements the middleware.Responder interface
type JSONMap ¶
type JSONMap map[string]interface{}
JSONMap is a helper for the postgres jsonb datatype
func (JSONMap) StringSlice ¶
StringSlice returns a string value for the param, or the optional default
type Link ¶
type Link struct {
// expires at
ExpiresAt int64 `json:"expires_at,omitempty"`
// the target url/uri
// Format: uri
Href strfmt.URI `json:"href,omitempty"`
// optional link name
Name *string `json:"name,omitempty"`
}
Link an href link object swagger:model Link
func (*Link) MarshalBinary ¶
MarshalBinary interface implementation
func (*Link) UnmarshalBinary ¶
UnmarshalBinary interface implementation
type Model ¶
type Model struct {
// Universally unique identifier
// Read Only: true
ID strfmt.UUID4 `json:"uuid,omitempty"`
// Date and time of object creation
// Read Only: true
CreatedAt strfmt.DateTime `json:"_created_at,omitempty" sql:"column:_created_at"`
// User uuid that created the object
// Read Only: true
CreatedBy string `json:"_created_by,omitempty" sql:"column:_created_by"`
// Last date of object modification
// Read Only: true
UpdatedAt strfmt.DateTime `json:"_updated_at,omitempty" sql:"column:_updated_at"`
// User that updated the object
// Read Only: true
UpdatedBy string `json:"_updated_by,omitempty" sql:"column:_updated_by"`
// meta
Meta *hstore.Hstore `json:"meta,omitempty"`
// tags
Tags StringArray `json:"tags,omitempty"`
}
Model is the base datebase model type used by Model Rocket
func (*Model) MarshalBinary ¶
MarshalBinary interface implementation
func (*Model) UnmarshalBinary ¶
UnmarshalBinary interface implementation
type Params ¶
type Params = JSONMap
Params is a simple type alias for a JSONMap
func ParseStringParams ¶
ParseStringParams parses a parameter string and returns a params object Example string: foo=bar aparam="value"
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response defines a simple middleware.Responder struct
func NewResponse ¶
func NewResponse(options ...*ResponseOptions) *Response
NewResponse returns a new response object
func (*Response) SetAcceleration ¶
SetAcceleration enables json acceleration
func (*Response) SetHeaderMap ¶
SetHeaderMap sets additional response headers
func (*Response) SetHeaders ¶
SetHeaders sets all of the headers
func (*Response) SetOptions ¶
func (r *Response) SetOptions(options ...*ResponseOptions) *Response
SetOptions sets the options for a response
func (*Response) SetPayload ¶
SetPayload sets the payload
func (*Response) StatusCode ¶
StatusCode returns the response http status code
func (*Response) WriteHeader ¶
WriteHeader implements the http.ResponseWriter.WriteHeader() method
func (*Response) WriteResponse ¶
func (r *Response) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
WriteResponse implements the middleware.Responder.WriteResponse() method
type ResponseOptions ¶
type ResponseOptions struct {
Request *http.Request
Encoding string
ContentType string
Binary bool
Acceleration bool
}
ResponseOptions defines responder options
type StringArray ¶
type StringArray pq.StringArray
StringArray is a proper string array type
func (*StringArray) Scan ¶
func (a *StringArray) Scan(src interface{}) error
Scan implements the sql.Scanner interface
type UUIDArray ¶
UUIDArray is a proper string array type
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/postgis
Package wkb implements Well Known Binary encoding and decoding.
|
Package wkb implements Well Known Binary encoding and decoding. |