Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed Nov 4, 2024
1 parent 4d136ca commit a08dcc0
Show file tree
Hide file tree
Showing 26 changed files with 81 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::agent::agent_client::AgentClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/applications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::applications::applications_client::ApplicationsClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::auth::authentication_client::AuthenticationClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::events::events_client::EventsClient::new(channel),
Expand Down
17 changes: 16 additions & 1 deletion packages/rust/armonik/src/client/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK clients for all the services
use std::sync::Arc;

use hyper::Uri;
Expand Down Expand Up @@ -33,8 +35,9 @@ pub use tasks::TasksClient;
pub use versions::VersionsClient;
pub use worker::WorkerClient;

/// ArmoniK Client
#[derive(Clone)]
pub struct Client<T> {
pub struct Client<T = tonic::transport::Channel> {
channel: T,
}

Expand Down Expand Up @@ -183,52 +186,64 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self { channel }
}

/// Create an [`AgentClient`]
pub fn agent(&self) -> AgentClient<T> {
AgentClient::with_channel(self.channel.clone())
}

/// Create an [`ApplicationsClient`]
pub fn applications(&self) -> ApplicationsClient<T> {
ApplicationsClient::with_channel(self.channel.clone())
}

/// Create an [`AuthClient`]
pub fn auth(&self) -> AuthClient<T> {
AuthClient::with_channel(self.channel.clone())
}

/// Create an [`EventsClient`]
pub fn events(&self) -> EventsClient<T> {
EventsClient::with_channel(self.channel.clone())
}

/// Create a [`PartitionsClient`]
pub fn partitions(&self) -> PartitionsClient<T> {
PartitionsClient::with_channel(self.channel.clone())
}

/// Create a [`ResultsClient`]
pub fn results(&self) -> ResultsClient<T> {
ResultsClient::with_channel(self.channel.clone())
}

/// Create a [`SessionsClient`]
pub fn sessions(&self) -> SessionsClient<T> {
SessionsClient::with_channel(self.channel.clone())
}

/// Create a [`SubmitterClient`]
#[deprecated]
#[allow(deprecated)]
pub fn submitter(&self) -> SubmitterClient<T> {
SubmitterClient::with_channel(self.channel.clone())
}

/// Create a [`TasksClient`]
pub fn tasks(&self) -> TasksClient<T> {
TasksClient::with_channel(self.channel.clone())
}

/// Create a [`VersionsClient`]
pub fn versions(&self) -> VersionsClient<T> {
VersionsClient::with_channel(self.channel.clone())
}

/// Create a [`WorkerClient`]
pub fn worker(&self) -> WorkerClient<T> {
WorkerClient::with_channel(self.channel.clone())
}
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/partitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::partitions::partitions_client::PartitionsClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::results::results_client::ResultsClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::sessions::sessions_client::SessionsClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/submitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::submitter::submitter_client::SubmitterClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::tasks::tasks_client::TasksClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::versions::versions_client::VersionsClient::new(channel),
Expand Down
1 change: 1 addition & 0 deletions packages/rust/armonik/src/client/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ where
T::ResponseBody: tonic::codegen::Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as tonic::codegen::Body>::Error: Into<tonic::codegen::StdError> + Send,
{
/// Build a client from a gRPC channel
pub fn with_channel(channel: T) -> Self {
Self {
inner: v3::worker::worker_client::WorkerClient::new(channel),
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Rust bindings for the ArmoniK API
pub mod api;
pub mod client;
mod objects;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/agent/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Agent service
mod result_metadata;

pub mod create_results;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/applications/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Applications service
pub mod filter;
pub mod list;

Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/auth/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Auth service
pub mod current_user;

mod user;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/events/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Events service
mod events_enum;
mod new_result;
mod new_task;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/filters/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to common filters
mod array_operator;
mod boolean_operator;
mod date_operator;
Expand Down
28 changes: 28 additions & 0 deletions packages/rust/armonik/src/objects/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//! The object module contains all the armonik objects for the API.
//! Each object has its own dedicated file that is re-exported here.
//! All services have their dedicated sub-modules, and rpcs have their own files within the service module which contains both a Request and Response object.
//!
//! Example:
//!
//! ```text
//! objects
//! + service1
//! | + rpc1
//! | | + Request
//! | | + Response
//! | + rpc2
//! | + Request
//! | + Response
//! + service2
//! | + rpc1
//! | + Request
//! | + Response
//! + common1
//! | + object1
//! | | + Object1
//! | + object2
//! | + Object2
//! + object1
//! + Object1
//! ```
mod configuration;
mod count;
mod data_chunk;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/partitions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Partitions service
pub mod filter;
pub mod get;
pub mod list;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/results/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Results service
pub mod create;
pub mod create_metadata;
pub mod delete;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/sessions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Sessions service
pub mod cancel;
pub mod close;
pub mod create;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/submitter/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Submitter service
pub mod cancel_session;
pub mod cancel_tasks;
pub mod count_tasks;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/tasks/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ArmoniK objects related to the Tasks service
pub mod cancel;
pub mod count_status;
pub mod filter;
Expand Down
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/versions/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
//! ArmoniK objects related to the Versions service
pub mod list;
2 changes: 2 additions & 0 deletions packages/rust/armonik/src/objects/worker/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//! ArmoniK objects related to the Worker service
pub mod health_check;
pub mod process;

0 comments on commit a08dcc0

Please sign in to comment.