Documentation ¶
Index ¶
- func Error404(w http.ResponseWriter, r *http.Request)
- func Error405(w http.ResponseWriter, r *http.Request)
- type ResponseWriter
- type Service
- func (r *Service) OnMiddlewareTrigger(res http.ResponseWriter, req *http.Request, msg string)
- func (r *Service) OnRequestContentCheck(_ *http.Request, contentType *string) (maxBody uint32, allow bool)
- func (r *Service) SetupMiddleware(router *mux.Router)
- func (r *Service) SetupRoutes(prefixes []string, router *mux.Router)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter is http.ResponseWriter that keeps status code
func (*ResponseWriter) WriteHeader ¶
func (rw *ResponseWriter) WriteHeader(status int)
WriteHeader impl.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service exposes endpoints on existing router to interact with blockchain via HTTP
func New ¶
func New(config *config.Root, reader dao.IDAO, pool *rpcpool.Pool, saveTXChan chan<- *types.Transaction, latency mtx.Histogram, count mtx.Counter) *Service
New instance
func (*Service) OnMiddlewareTrigger ¶
OnMiddlewareTrigger will be invoked on middleware triggering
func (*Service) OnRequestContentCheck ¶
func (r *Service) OnRequestContentCheck(_ *http.Request, contentType *string) (maxBody uint32, allow bool)
OnRequestContentCheck will be invoked on content checking (middleware). Content type is nil on GET requests (i.e. when body is not presented)
func (*Service) SetupMiddleware ¶
SetupMiddleware for HTTP server
Click to show internal directories.
Click to hide internal directories.