Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventsAPI ¶
func NewEventsAPI() (events.EventProducer, httprouter.Handle)
NewEventsAPI creates an EventProducer that generates cache events from HTTP requests. The returned httprouter.Handle must be registered on both POST (update) and DELETE (invalidate) methods and provided an `:id` param via the URL, e.g.:
apiEvents, apiEventsHandler, err := NewEventsApi() router.POST("/stored_requests", apiEventsHandler) router.DELETE("/stored_requests", apiEventsHandler) listener := events.Listen(cache, apiEvents)
The returned HTTP endpoint should not be exposed on a public network without authentication as it allows direct writing to the cache via Update.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.