You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
// Delete an event registration (must have been created by this service).
Delete(string) error
// List all available events
List() ([]string, error)
}
(note that the comment in this code is not really correct - the event manager is responsible for exposing event sources/services - not registrations. That's for what's below.
Implement the localhost SubscriptionManager responsible for exposing subscriptions to events:
Description
The
Adapter
interface provides concrete realizations of anEventManager
andSubscriptionManager
for a specific platform - in this case, localhost. A function can query thegrid
REST API to list, create and delete event sources and types. Note that this aligns quite well with the proposed CNCFCloudSubscriptions
Discovery API. A function may also query thegrid
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 withgrid
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 theEventManager
andSubscriptionManager
interfaces for localhost. The usage scenario is when a developer is creating, testing and changing a function locally. TheAdapter
should be capable of exposing mock services and events. Further iterations of theAdapter
may also consider providing configuration options, such that it can expose actual, running services. For example, a localhostAdapter
could be configured to expose events and subscriptions from a local or remote Kafka service.Endpoints
/v1/subscriptions
./v1/events
. (Note, I think we should consider changing this to/v1/services
to align better with CNCF)Interfaces
Adapter
interface:grid/grid.go
Lines 25 to 29 in f6f3f6c
EventManager
, responsible for exposing available services / events:grid/grid.go
Lines 42 to 49 in f6f3f6c
SubscriptionManager
responsible for exposing subscriptions to events:grid/grid.go
Lines 32 to 39 in f6f3f6c
The text was updated successfully, but these errors were encountered: