Struct near_lake_framework::LakeConfigBuilder
source · [−]pub struct LakeConfigBuilder { /* private fields */ }
Expand description
Builder for LakeConfig
.
Implementations
sourceimpl LakeConfigBuilder
impl LakeConfigBuilder
sourcepub fn s3_bucket_name<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn s3_bucket_name<VALUE: Into<String>>(self, value: VALUE) -> Self
AWS S3 Bucket name
sourcepub fn s3_region_name<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn s3_region_name<VALUE: Into<String>>(self, value: VALUE) -> Self
AWS S3 Region name
sourcepub fn start_block_height(self, value: u64) -> Self
pub fn start_block_height(self, value: u64) -> Self
Defines the block height to start indexing from
sourcepub fn s3_config(self, value: Config) -> Self
pub fn s3_config(self, value: Config) -> Self
Custom aws_sdk_s3::config::Config
Use-case: custom endpoint
You might want to stream data from the custom S3-compatible source () . In order to do that you’d need to pass aws_sdk_s3::config::Config
configured
use aws_sdk_s3::Endpoint;
use http::Uri;
use near_lake_framework::LakeConfigBuilder;
let aws_config = aws_config::from_env().load().await;
let mut s3_conf = aws_sdk_s3::config::Builder::from(&aws_config);
s3_conf = s3_conf
.endpoint_resolver(
Endpoint::immutable("http://0.0.0.0:9000".parse::<Uri>().unwrap()))
.build();
let config = LakeConfigBuilder::default()
.s3_config(s3_conf)
.s3_bucket_name("near-lake-data-custom")
.start_block_height(1)
.build()
.expect("Failed to build LakeConfig");
sourcepub fn build(self) -> Result<LakeConfig, LakeConfigBuilderError>
pub fn build(self) -> Result<LakeConfig, LakeConfigBuilderError>
sourceimpl LakeConfigBuilder
impl LakeConfigBuilder
sourcepub fn mainnet(self) -> Self
pub fn mainnet(self) -> Self
Shortcut to set up LakeConfigBuilder::s3_bucket_name for mainnet
use near_lake_framework::LakeConfigBuilder;
let config = LakeConfigBuilder::default()
.mainnet()
.start_block_height(65231161)
.build()
.expect("Failed to build LakeConfig");
sourcepub fn testnet(self) -> Self
pub fn testnet(self) -> Self
Shortcut to set up LakeConfigBuilder::s3_bucket_name for testnet
use near_lake_framework::LakeConfigBuilder;
let config = LakeConfigBuilder::default()
.testnet()
.start_block_height(82422587)
.build()
.expect("Failed to build LakeConfig");
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LakeConfigBuilder
impl Send for LakeConfigBuilder
impl Sync for LakeConfigBuilder
impl Unpin for LakeConfigBuilder
impl !UnwindSafe for LakeConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more