api

package
v0.0.0-...-97a8816 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL