Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureStatsD()
- func NewArchiveHandler(db *sql.DB, linkhostport string) (func(rw http.ResponseWriter, req *http.Request), error)
- func NewEventRetrieveHandler(db *sql.DB) (func(rw http.ResponseWriter, req *http.Request), error)
- func NewRecentHandler(db *sql.DB, linkhostport string) (func(rw http.ResponseWriter, req *http.Request), error)
- type EventStoreContent
Constants ¶
const ( RecentHandlerURI = "/notifications/recent" ArchiveHandlerURI = "/notifications/{feedId}" RetrieveEventHanderURI = "/events/{aggregateId}/{version}" )
URIs assumed by handlers - these are fixed as they embed references relative to the URIs used in this package
Variables ¶
var ErrBadDBConnection = errors.New("Nil db passed to factory method")
Functions ¶
func ConfigureStatsD ¶
func ConfigureStatsD()
Configure where telemery data does. Currently this can be send via UDP to a listener, or can be buffered internally and dumped via a signal.
func NewArchiveHandler ¶
func NewArchiveHandler(db *sql.DB, linkhostport string) (func(rw http.ResponseWriter, req *http.Request), error)
NewArchiveHandler instantiates a handler for retrieving feed archives, which is a set of events associated with a specific feed id. This will be served up at /notifications/{feedId} The linkhostport argument is used to set the host and port in the link relations URL. This is useful when proxying the feed, in which case the link relation URLs can reflect the proxied URLs, not the direct URL.
func NewEventRetrieveHandler ¶
NewRetrieveHandler instantiates a handler for the retrieval of specific events by aggregate id and version. This will be served at /notifications/{aggregateId}/{version}
func NewRecentHandler ¶
func NewRecentHandler(db *sql.DB, linkhostport string) (func(rw http.ResponseWriter, req *http.Request), error)
NewRecentHandler instantiates the handler for retrieve recent notifications, which are those that have not yet been assigned a feed id. This will be served up at /notifications/recent The linkhostport argument is used to set the host and port in the link relations URL. This is useful when proxying the feed, in which case the link relation URLs can reflect the proxied URLs, not the direct URL.
Types ¶
type EventStoreContent ¶
type EventStoreContent struct { XMLName xml.Name `xml:"http://github.com/xtracdev/goes event"` AggregateId string `xml:"aggregateId"` Version int `xml:"version"` Published time.Time `xml:"published"` TypeCode string `xml:"typecode"` Content string `xml:"content"` }
Used to serialize event store content when directly retrieving using aggregate id and version