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