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
fn commit_cursors_budgeted<T: AsRef<[u8]>>(
&self,
subscription_id: &SubscriptionId,
stream_id: &StreamId,
cursors: &[T],
flow_id: FlowId,
budget: Duration
) -> Result<CommitStatus, CommitError>
&self,
subscription_id: &SubscriptionId,
stream_id: &StreamId,
cursors: &[T],
flow_id: FlowId,
budget: Duration
) -> Result<CommitStatus, CommitError>
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.
fn delete_event_type(
&self,
event_type_name: &str
) -> Result<(), DeleteEventTypeError>
&self,
event_type_name: &str
) -> Result<(), DeleteEventTypeError>
fn create_event_type(
&self,
event_type: &EventTypeDefinition
) -> Result<(), CreateEventTypeError>
&self,
event_type: &EventTypeDefinition
) -> Result<(), CreateEventTypeError>
fn create_subscription(
&self,
request: &SubscriptionRequest
) -> Result<CreateSubscriptionStatus, CreateSubscriptionError>
&self,
request: &SubscriptionRequest
) -> Result<CreateSubscriptionStatus, CreateSubscriptionError>
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.
fn delete_subscription(
&self,
id: &SubscriptionId
) -> Result<(), DeleteSubscriptionError>
&self,
id: &SubscriptionId
) -> Result<(), DeleteSubscriptionError>
Deletes a Subscription
identified by a SubscriptionId
.
Errors
The subscription could not be deleted.
Provided Methods
fn commit_cursors<T: AsRef<[u8]>>(
&self,
subscription_id: &SubscriptionId,
stream_id: &StreamId,
cursors: &[T],
flow_id: FlowId
) -> Result<CommitStatus, CommitError>
&self,
subscription_id: &SubscriptionId,
stream_id: &StreamId,
cursors: &[T],
flow_id: FlowId
) -> Result<CommitStatus, CommitError>
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
impl ApiClient for NakadiApiClient