File tree Expand file tree Collapse file tree 3 files changed +105
-0
lines changed
Expand file tree Collapse file tree 3 files changed +105
-0
lines changed Original file line number Diff line number Diff line change 1+ # Basic ILP examples
2+ - name : ilp
3+ lang : c
4+ path : examples/line_sender_c_example.c
5+ header : |-
6+ [C client library docs](https://github.com/questdb/c-questdb-client/blob/main/doc/C.md)
7+
8+ - name : ilp
9+ lang : cpp
10+ path : examples/line_sender_cpp_example.cpp
11+ header : |-
12+ [C++ client library docs](https://github.com/questdb/c-questdb-client/blob/main/doc/CPP.md)
13+
14+ - name : ilp
15+ lang : rust
16+ path : questdb-rs/examples/basic.rs
17+ header : |-
18+ [Rust client library docs](https://docs.rs/crate/questdb-rs/latest)
19+
20+ # ILP Auth + TLS Examples
21+ - name : ilp-auth-tls
22+ lang : c
23+ path : examples/line_sender_c_example_tls.c
24+ header : |-
25+ [C client library docs](https://github.com/questdb/c-questdb-client/blob/main/doc/C.md)
26+ auth :
27+ kid : testUser1
28+ d : 5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48
29+ x : fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU
30+ y : Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac
31+
32+ - name : ilp-auth-tls
33+ lang : cpp
34+ path : examples/line_sender_cpp_example_tls.cpp
35+ header : |-
36+ [C++ client library docs](https://github.com/questdb/c-questdb-client/blob/main/doc/CPP.md)
37+ auth :
38+ kid : testUser1
39+ d : 5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48
40+ x : fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU
41+ y : Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac
42+
43+ - name : ilp-auth-tls
44+ lang : rust
45+ path : questdb-rs/examples/auth_tls.rs
46+ header : |-
47+ [Rust client library docs](https://docs.rs/crate/questdb-rs/latest)
48+ auth :
49+ kid : testUser1
50+ d : 5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48
51+ x : fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU
52+ y : Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac
Original file line number Diff line number Diff line change 1+ use questdb:: {
2+ Result ,
3+ ingress:: {
4+ Buffer ,
5+ SenderBuilder ,
6+ Tls ,
7+ CertificateAuthority } } ;
8+
9+ fn main ( ) -> Result < ( ) > {
10+ let host: String = std:: env:: args ( ) . nth ( 1 )
11+ . unwrap_or ( "localhost" . to_string ( ) ) ;
12+ let port: u16 = std:: env:: args ( ) . nth ( 2 )
13+ . unwrap_or ( "9009" . to_string ( ) ) . parse ( ) . unwrap ( ) ;
14+ let mut sender = SenderBuilder :: new ( host, port)
15+ . auth (
16+ "testUser1" , // kid
17+ "5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48" , // d
18+ "fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU" , // x
19+ "Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac" ) // y
20+ . tls ( Tls :: Enabled ( CertificateAuthority :: WebpkiRoots ) )
21+ . connect ( ) ?;
22+ let mut buffer = Buffer :: new ( ) ;
23+ buffer
24+ . table ( "sensors" ) ?
25+ . symbol ( "id" , "toronto1" ) ?
26+ . column_f64 ( "temperature" , 20.0 ) ?
27+ . column_i64 ( "humidity" , 50 ) ?
28+ . at_now ( ) ?;
29+ sender. flush ( & mut buffer) ?;
30+ Ok ( ( ) )
31+ }
Original file line number Diff line number Diff line change 1+ use questdb:: {
2+ Result ,
3+ ingress:: {
4+ Buffer ,
5+ SenderBuilder } } ;
6+
7+ fn main ( ) -> Result < ( ) > {
8+ let host: String = std:: env:: args ( ) . nth ( 1 )
9+ . unwrap_or ( "localhost" . to_string ( ) ) ;
10+ let port: u16 = std:: env:: args ( ) . nth ( 2 )
11+ . unwrap_or ( "9009" . to_string ( ) ) . parse ( ) . unwrap ( ) ;
12+ let mut sender = SenderBuilder :: new ( host, port) . connect ( ) ?;
13+ let mut buffer = Buffer :: new ( ) ;
14+ buffer
15+ . table ( "sensors" ) ?
16+ . symbol ( "id" , "toronto1" ) ?
17+ . column_f64 ( "temperature" , 20.0 ) ?
18+ . column_i64 ( "humidity" , 50 ) ?
19+ . at_now ( ) ?;
20+ sender. flush ( & mut buffer) ?;
21+ Ok ( ( ) )
22+ }
You can’t perform that action at this time.
0 commit comments