Versions in this module Expand all Collapse all v1 v1.1.3 Feb 6, 2015 Changes in this version + const HEADER_AccessControlMaxAge + func TraceLogger(logger *log.Logger) type Container + func (c Container) HandleWithFilter(pattern string, handler http.Handler) type CrossOriginResourceSharing + AllowedMethods []string + MaxAge int type Response + func (r *Response) PrettyPrint(bePretty bool) + func (r *Response) SetRequestAccepts(mime string) + type ResponseError struct + Code int + Message string + Model interface{} type Route + Notes string + ResponseErrors map[int]ResponseError type RouteBuilder + func (b *RouteBuilder) Do(oneArgBlocks ...func(*RouteBuilder)) *RouteBuilder + func (b *RouteBuilder) Notes(notes string) *RouteBuilder + func (b *RouteBuilder) Returns(code int, message string, model interface{}) *RouteBuilder + func (b *RouteBuilder) ReturnsError(code int, message string, model interface{}) *RouteBuilder type WebService + func (w *WebService) ApiVersion(apiVersion string) *WebService + func (w WebService) Version() string v1.1.2 Aug 30, 2014 Changes in this version + func DefaultRequestContentType(mime string) + func DefaultResponseContentType(mime string) + func SetCacheReadEntity(doCache bool) type Container + ServeMux *http.ServeMux type CrossOriginResourceSharing + AllowedDomains []string type RouteBuilder + func (b RouteBuilder) ParameterNamed(name string) (p *Parameter) v1.1.1 May 4, 2014 v1.1.0 Apr 16, 2014 Changes in this version type Request + func NewRequest(httpRequest *http.Request) *Request v1.0.1 Apr 14, 2014 Changes in this version + var PrettyPrintResponses = true v1.0.0 Apr 1, 2014 Changes in this version + const BodyParameterKind + const ENCODING_DEFLATE + const ENCODING_GZIP + const FormParameterKind + const HEADER_Accept + const HEADER_AcceptEncoding + const HEADER_AccessControlAllowCredentials + const HEADER_AccessControlAllowHeaders + const HEADER_AccessControlAllowMethods + const HEADER_AccessControlAllowOrigin + const HEADER_AccessControlExposeHeaders + const HEADER_AccessControlRequestHeaders + const HEADER_AccessControlRequestMethod + const HEADER_Allow + const HEADER_ContentEncoding + const HEADER_ContentType + const HEADER_LastModified + const HEADER_Origin + const HeaderParameterKind + const MIME_JSON + const MIME_XML + const PathParameterKind + const QueryParameterKind + var DefaultResponseMimeType string + var DoNotRecover = false + var EnableContentEncoding = false + func Add(service *WebService) + func Filter(filter FilterFunction) + type CompressingResponseWriter struct + func NewCompressingResponseWriter(httpWriter http.ResponseWriter, encoding string) (*CompressingResponseWriter, error) + func (c *CompressingResponseWriter) Close() + func (c *CompressingResponseWriter) CloseNotify() <-chan bool + func (c *CompressingResponseWriter) Header() http.Header + func (c *CompressingResponseWriter) Write(bytes []byte) (int, error) + func (c *CompressingResponseWriter) WriteHeader(status int) + type Container struct + var DefaultContainer *Container + func NewContainer() *Container + func (c *Container) Add(service *WebService) *Container + func (c *Container) DoNotRecover(doNot bool) + func (c *Container) EnableContentEncoding(enabled bool) + func (c *Container) Filter(filter FilterFunction) + func (c *Container) RecoverHandler(handler RecoverHandleFunction) + func (c *Container) Router(aRouter RouteSelector) + func (c Container) Handle(pattern string, handler http.Handler) + func (c Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) + func (c Container) RegisteredWebServices() []*WebService + func (c Container) ServeHTTP(httpwriter http.ResponseWriter, httpRequest *http.Request) + type CrossOriginResourceSharing struct + AllowedHeaders []string + Container *Container + CookiesAllowed bool + ExposeHeaders []string + func (c CrossOriginResourceSharing) Filter(req *Request, resp *Response, chain *FilterChain) + type CurlyRouter struct + func (c CurlyRouter) SelectRoute(webServices []*WebService, httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) + type FilterChain struct + Filters []FilterFunction + Index int + Target RouteFunction + func (f *FilterChain) ProcessFilter(request *Request, response *Response) + type FilterFunction func(*Request, *Response, *FilterChain) + func OPTIONSFilter() FilterFunction + type Parameter struct + func (p *Parameter) AllowMultiple(multiple bool) *Parameter + func (p *Parameter) AllowableValues(values map[string]string) *Parameter + func (p *Parameter) Data() ParameterData + func (p *Parameter) DataType(typeName string) *Parameter + func (p *Parameter) Kind() int + func (p *Parameter) Required(required bool) *Parameter + type ParameterData struct + AllowMultiple bool + AllowableValues map[string]string + DataType string + Description string + Kind int + Name string + Required bool + type RecoverHandleFunction func(interface{}, http.ResponseWriter) + type Request struct + Request *http.Request + func (r *Request) BodyParameter(name string) (string, error) + func (r *Request) HeaderParameter(name string) string + func (r *Request) PathParameter(name string) string + func (r *Request) PathParameters() map[string]string + func (r *Request) QueryParameter(name string) string + func (r *Request) ReadEntity(entityPointer interface{}) (err error) + func (r *Request) SetAttribute(name string, value interface{}) + func (r Request) Attribute(name string) interface{} + func (r Request) SelectedRoutePath() string + type Response struct + func NewResponse(httpWriter http.ResponseWriter) *Response + func (r *Response) Write(bytes []byte) (int, error) + func (r *Response) WriteAsJson(value interface{}) error + func (r *Response) WriteAsXml(value interface{}) error + func (r *Response) WriteEntity(value interface{}) error + func (r *Response) WriteError(httpStatus int, err error) error + func (r *Response) WriteErrorString(status int, errorReason string) error + func (r *Response) WriteHeader(httpStatus int) + func (r *Response) WriteServiceError(httpStatus int, err ServiceError) error + func (r Response) AddHeader(header string, value string) Response + func (r Response) CloseNotify() <-chan bool + func (r Response) ContentLength() int + func (r Response) InternalServerError() Response + func (r Response) StatusCode() int + type Route struct + Consumes []string + Doc string + Filters []FilterFunction + Function RouteFunction + Method string + Operation string + ParameterDocs []*Parameter + Path string + Produces []string + ReadSample interface{} + WriteSample interface{} + func (r Route) String() string + type RouteBuilder struct + func (b *RouteBuilder) Build() Route + func (b *RouteBuilder) Consumes(mimeTypes ...string) *RouteBuilder + func (b *RouteBuilder) Doc(documentation string) *RouteBuilder + func (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder + func (b *RouteBuilder) Method(method string) *RouteBuilder + func (b *RouteBuilder) Operation(name string) *RouteBuilder + func (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder + func (b *RouteBuilder) Path(subPath string) *RouteBuilder + func (b *RouteBuilder) Produces(mimeTypes ...string) *RouteBuilder + func (b *RouteBuilder) Reads(sample interface{}) *RouteBuilder + func (b *RouteBuilder) To(function RouteFunction) *RouteBuilder + func (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder + type RouteFunction func(*Request, *Response) + type RouteSelector interface + SelectRoute func(webServices []*WebService, httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) + type RouterJSR311 struct + func (r RouterJSR311) SelectRoute(webServices []*WebService, httpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) + type ServiceError struct + Code int + Message string + func NewError(code int, message string) ServiceError + func (s ServiceError) Error() string + type WebService struct + func RegisteredWebServices() []*WebService + func (w *WebService) BodyParameter(name, description string) *Parameter + func (w *WebService) Consumes(accepts ...string) *WebService + func (w *WebService) DELETE(subPath string) *RouteBuilder + func (w *WebService) Doc(plainText string) + func (w *WebService) Filter(filter FilterFunction) *WebService + func (w *WebService) FormParameter(name, description string) *Parameter + func (w *WebService) GET(subPath string) *RouteBuilder + func (w *WebService) HEAD(subPath string) *RouteBuilder + func (w *WebService) HeaderParameter(name, description string) *Parameter + func (w *WebService) Method(httpMethod string) *RouteBuilder + func (w *WebService) PATCH(subPath string) *RouteBuilder + func (w *WebService) POST(subPath string) *RouteBuilder + func (w *WebService) PUT(subPath string) *RouteBuilder + func (w *WebService) Param(parameter *Parameter) *WebService + func (w *WebService) Path(root string) *WebService + func (w *WebService) PathParameter(name, description string) *Parameter + func (w *WebService) Produces(contentTypes ...string) *WebService + func (w *WebService) QueryParameter(name, description string) *Parameter + func (w *WebService) Route(builder *RouteBuilder) *WebService + func (w WebService) Documentation() string + func (w WebService) PathParameters() []*Parameter + func (w WebService) RootPath() string + func (w WebService) Routes() []Route