feldera_types/transport/
file.rs

1use serde::{Deserialize, Serialize};
2use utoipa::ToSchema;
3
4/// Configuration for reading data from a file with `FileInputTransport`
5#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
6pub struct FileInputConfig {
7    /// File path.
8    pub path: String,
9
10    /// Read buffer size.
11    ///
12    /// Default: when this parameter is not specified, a platform-specific
13    /// default is used.
14    pub buffer_size_bytes: Option<usize>,
15
16    /// Enable file following.
17    ///
18    /// When `false`, the endpoint outputs an `InputConsumer::eoi`
19    /// message and stops upon reaching the end of file.  When `true`, the
20    /// endpoint will keep watching the file and outputting any new content
21    /// appended to it.
22    #[serde(default)]
23    pub follow: bool,
24}
25
26/// Configuration for writing data to a file with `FileOutputTransport`.
27#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
28pub struct FileOutputConfig {
29    /// File path.
30    pub path: String,
31}