Description
Description
The Adapter
interface provides concrete realizations of an EventManager
and SubscriptionManager
for a specific platform - in this case, localhost. A function can query the grid
REST API to list, create and delete event sources and types. Note that this aligns quite well with the proposed CNCF CloudSubscriptions
Discovery API. A function may also query the grid
API to list, create and delete event subscriptions. This aligns well with the proposed CNCF CloudEvents Subscriptions API. We should track and be involved with these CNCF projects as we move forward with grid
implementation, and consider making our exposed API align with these specifications.
The first Adapter
implementation will be for localhost. We will need to provide endpoints for the REST API, and implement the EventManager
and SubscriptionManager
interfaces for localhost. The usage scenario is when a developer is creating, testing and changing a function locally. The Adapter
should be capable of exposing mock services and events. Further iterations of the Adapter
may also consider providing configuration options, such that it can expose actual, running services. For example, a localhost Adapter
could be configured to expose events and subscriptions from a local or remote Kafka service.
Endpoints
- Provide HTTP handlers for creating, listing and deleting event subscriptions at the endpoint
/v1/subscriptions
. - Provide HTTP handlers for creating, listing, (querying?) and deleting event sources and their types at
/v1/events
. (Note, I think we should consider changing this to/v1/services
to align better with CNCF)
Interfaces
- Implement the localhost
Adapter
interface:Lines 25 to 29 in f6f3f6c
- Implement the localhost
EventManager
, responsible for exposing available services / events:Lines 42 to 49 in f6f3f6c
- Implement the localhost
SubscriptionManager
responsible for exposing subscriptions to events:Lines 32 to 39 in f6f3f6c
Activity