Documentation
¶
Overview ¶
Package rs is a library for implementing RESTful APIs, inspired by JAX-RS Once it is mature, it should probably be carved out into its own library
Index ¶
- type HttpErrorObject
- type HttpResponse
- type JsonMessageBodyReader
- type JsonMessageBodyWriter
- type MediaType
- type MessageBodyReader
- type MessageBodyWriter
- type NoResponseMessageBodyWriter
- type RestEndpointHandler
- type RestServer
- func (self *RestServer) AddEndpoint(path string, t reflect.Type) *RestEndpointHandler
- func (self *RestServer) AddReader(mbr MessageBodyReader)
- func (self *RestServer) AddWriter(mbw MessageBodyWriter)
- func (self *RestServer) ListenAndServe() error
- func (self *RestServer) SetListen(listen string)
- func (self *RestServer) WithInjector(injector inject.Injector)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpErrorObject ¶
func ErrNotFound ¶
func ErrNotFound() *HttpErrorObject
func HttpError ¶
func HttpError(status int) *HttpErrorObject
func (*HttpErrorObject) Error ¶
func (self *HttpErrorObject) Error() string
type HttpResponse ¶
type JsonMessageBodyReader ¶
type JsonMessageBodyReader struct { }
func NewJsonMessageBodyReader ¶
func NewJsonMessageBodyReader() *JsonMessageBodyReader
func (*JsonMessageBodyReader) IsReadable ¶
type JsonMessageBodyWriter ¶
type JsonMessageBodyWriter struct { }
func NewJsonMessageBodyWriter ¶
func NewJsonMessageBodyWriter() *JsonMessageBodyWriter
func (*JsonMessageBodyWriter) IsWritable ¶
func (*JsonMessageBodyWriter) Write ¶
func (self *JsonMessageBodyWriter) Write(o interface{}, t reflect.Type, req *http.Request, res http.ResponseWriter) error
type MediaType ¶
type MediaType struct { Type string Subtype string Parameters map[string]string // contains filtered or unexported fields }
func ParseMediaType ¶
type MessageBodyReader ¶
type MessageBodyWriter ¶
type NoResponseMessageBodyWriter ¶
type NoResponseMessageBodyWriter struct { }
func (*NoResponseMessageBodyWriter) IsWritable ¶
func (*NoResponseMessageBodyWriter) Write ¶
func (self *NoResponseMessageBodyWriter) Write(o interface{}, t reflect.Type, req *http.Request, res http.ResponseWriter) error
type RestEndpointHandler ¶
type RestEndpointHandler struct {
// contains filtered or unexported fields
}
type RestServer ¶
type RestServer struct {
// contains filtered or unexported fields
}
func NewRestServer ¶
func NewRestServer() *RestServer
func (*RestServer) AddEndpoint ¶
func (self *RestServer) AddEndpoint(path string, t reflect.Type) *RestEndpointHandler
func (*RestServer) AddReader ¶
func (self *RestServer) AddReader(mbr MessageBodyReader)
func (*RestServer) AddWriter ¶
func (self *RestServer) AddWriter(mbw MessageBodyWriter)
func (*RestServer) ListenAndServe ¶
func (self *RestServer) ListenAndServe() error
func (*RestServer) SetListen ¶
func (self *RestServer) SetListen(listen string)
func (*RestServer) WithInjector ¶
func (self *RestServer) WithInjector(injector inject.Injector)
Click to show internal directories.
Click to hide internal directories.