Trait nakadion::api::ApiClient[][src]

pub trait ApiClient {
    fn commit_cursors_budgeted<T: AsRef<[u8]>>(
        &self,
        subscription_id: &SubscriptionId,
        stream_id: &StreamId,
        cursors: &[T],
        flow_id: FlowId,
        budget: Duration
    ) -> Result<CommitStatus, CommitError>;
fn delete_event_type(
        &self,
        event_type_name: &str
    ) -> Result<(), DeleteEventTypeError>;
fn create_event_type(
        &self,
        event_type: &EventTypeDefinition
    ) -> Result<(), CreateEventTypeError>;
fn create_subscription(
        &self,
        request: &SubscriptionRequest
    ) -> Result<CreateSubscriptionStatus, CreateSubscriptionError>;
fn delete_subscription(
        &self,
        id: &SubscriptionId
    ) -> Result<(), DeleteSubscriptionError>; fn commit_cursors<T: AsRef<[u8]>>(
        &self,
        subscription_id: &SubscriptionId,
        stream_id: &StreamId,
        cursors: &[T],
        flow_id: FlowId
    ) -> Result<CommitStatus, CommitError> { ... } }

A REST client for the Nakadi API.

This accesses the REST API only and does not provide functionality for streaming.

Required Methods

Commit the cursors encoded in the given bytes.

A commit can only be done on a valid stream identified by its id.

This method will retry for the Duration defined by budget in case of a failure.

Errors

The cursors could not be comitted.

Deletes an event type.

Errors

The event type could not be deleted.

Creates an event type defined by EventTypeDefinition.

Errors

The event type could not be created.

Creates an new subscription defined by a SubscriptionRequest.

Trying to create a Subscription that already existed is not considered a failure. See CreateSubscriptionStatus for mor details.

Errors

The subscription could not be created.

Deletes a Subscription identified by a SubscriptionId.

Errors

The subscription could not be deleted.

Provided Methods

Commit the cursors encoded in the given bytes.

A commit can only be done on a valid stream identified by its id.

This method will retry for 500ms in case of a failure.

Errors

The cursors could not be comitted.

Implementors