atompubsvc

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

README

Event Store Atom Publisher

CircleCI

This project provides an atom feed of published events from the oraeventstore.

Overview

For an event store, this project provides an atom feed of published events. The events are organized into feeds based on a number of events per feed, as processed by the es-atom-data project.

The most recent events are not associated with a feed, these may be retrieved via the /notifications/recent resource. Events associated with a feed may be retrieved via the /notifications/{feedid} resource.

Additionally, events may be retrieved individually via /notifications/{aggregate_id}/{version}

Based on semantics associated with event stores (immutable events), cache headers are returned for feed pages and entities indicating they may be cached for 30 days. The recent page is denoted as uncacheable as new events may be added to it up the point it is archived by associating the events with a specific feed id.

Health check inspection

To troubleshoot the container health check, use docker inspect, e.g.

docker inspect --format "{{json .State.Health }}" container-name

For example: docker inspect --format "{{json .State.Health }}" devcenter_nginxproxy_1

Contributing

To contribute, you must certify you agree with the Developer Certificate of Origin by signing your commits via git -s. To create a signature, configure your user name and email address in git. Sign with your real name, do not use pseudonyms or submit anonymous commits.

In terms of workflow:

  1. For significant changes or improvement, create an issue before commencing work.
  2. Fork the respository, and create a branch for your edits.
  3. Add tests that cover your changes, unit tests for smaller changes, acceptance test for more significant functionality.
  4. Run gofmt on each file you change before committing your changes.
  5. Run golint on each file you change before committing your changes.
  6. Make sure all the tests pass before committing your changes.
  7. Commit your changes and issue a pull request.

License

(c) 2016 Fidelity Investments Licensed under the Apache License, Version 2.0

Documentation

Index

Constants

View Source
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

View Source
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

func NewEventRetrieveHandler(db *sql.DB) (func(rw http.ResponseWriter, req *http.Request), error)

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

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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