Browse Source

0.1.12

master 0.1.12
bean 1 year ago
parent
commit
7f18d3c57b
  1. 2
      Cargo.toml
  2. 4
      RELEASE_NOTE.md
  3. 7
      src/aws/kinesis.rs

2
Cargo.toml

@ -1,6 +1,6 @@
[package]
name = "device-common"
version = "0.1.11"
version = "0.1.12"
edition = "2021"
authors = ["Ryan Bae <jh.bae@anypointmedia.com>"]

4
RELEASE_NOTE.md

@ -1,3 +1,7 @@
0.1.12
======
- kinesis 에 byte array 로 put 하는 함수 추가
0.1.11
======
- metrics 통합

7
src/aws/kinesis.rs

@ -33,6 +33,11 @@ async fn get_client() -> Arc<Client> {
pub async fn kinesis_put_record(msg: &String) -> Result<(), DeviceError> {
let blob = msg.as_bytes();
kinesis_put_bytes(blob)
}
pub async fn kinesis_put_bytes(bytes: &[u8]) -> Result<(), DeviceError> {
let config = crate::config::get_config()
.await
.clone();
@ -40,7 +45,7 @@ pub async fn kinesis_put_record(msg: &String) -> Result<(), DeviceError> {
get_client()
.await
.put_record()
.data(Blob::new(blob))
.data(Blob::new(bytes))
.partition_key(&config.kinesis_stream.node.partition_key)
.stream_name(&config.kinesis_stream.node.name)
.stream_arn(&config.kinesis_stream.node.arn)

Loading…
Cancel
Save