Coder Social home page Coder Social logo

consulrs's Introduction

Hi there, I'm Josh ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on a new blog series
  • ๐ŸŒฑ Iโ€™m currently learning development best practices
  • ๐Ÿ’ฌ Ask me about my homelab
  • ๐Ÿ“ซ How to find me:

Josh's github stats

consulrs's People

Contributors

jmgilman avatar justinmir avatar simorex80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

consulrs's Issues

Blocking takes a u64 For index but ApiResponse returns a string

I am trying to make some blocking calls against the key value store to keep a watch on a value.

This means I need to make requests with the index Blocking feature set.

I am using the below

https://docs.rs/consulrs/latest/consulrs/api/features/struct.Blocking.html

https://docs.rs/consulrs/latest/consulrs/api/struct.ApiResponse.html

                let mut res = consulrs::kv::read(
                    &consul_client,
                    &key,
                    Some(
                        ReadKeyRequestBuilder::default()
                            .key(&key)
                            .features(
                                consulrs::api::features::Features {
                                    blocking: Some(consulrs::api::features::Blocking {
                                        index:my_index,
                                        wait: Some("500s".to_string()),
                                    }),
                                    ..consulrs::api::features::Features::default()
                                }
                            )
                            .recurse(false),
                    ),
                )
                .await;

Is there an easier way to do this without having to convert the index to a string or u64 in the request response loop.

Bug in crate published on crates.io

In the version on crates.io, services::health_by_id has a parsing error because of a wrong return type (Result<ApiResponse<Vec<AgentServiceChecksInfo>>, ClientError> instead of Result<ApiResponse<AgentServiceChecksInfo>, ClientError>). On master, this is fixed, so a new version could be published on crates.io which contains this fix.

RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations

Potential segfault in localtime_r invocations

Details
Package chrono
Version 0.4.19
URL chronotope/chrono#499
Date 2020-11-10

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

Workarounds

No workarounds are known.

References

See advisory page for additional details.

Json parse error on consul 1.10.4

Im trying to list all registered services on consul 1.10.4. And its seems that serde_json can't parse response from consul.
ResponseParseError { source: invalid type: map, expected a string at line 1 column 135, content: Some(\"{\\\"test_service\\\":{\\\"ID\\\":\\\"test_service\\\",\\\"Service\\\":\\\"test_service\\\",\\\"Tags\\\":[],\\\"Meta\\\":{},\\\"Port\\\":1234,\\\"Address\\\":\\\"172.22.0.5\\\",\\\"TaggedAddresses\\\":{\\\"lan_ipv4\\\":{\\\"Address\\\":\\\"172.22.0.5\\\",\\\"Port\\\":1234},\\\"wan_ipv4\\\":{\\\"Address\\\":\\\"172.22.0.5\\\",\\\"Port\\\":1234}},\\\"Weights\\\":{\\\"Passing\\\":1,\\\"Warning\\\":1},\\\"EnableTagOverride\\\":false,\\\"Datacenter\\\":\\\"dc1\\\"}}\") } }"

RUSTSEC-2020-0071: Potential segfault in the time crate

Potential segfault in the time crate

Details
Package time
Version 0.1.43
URL time-rs/time#293
Date 2020-11-18
Patched versions >=0.2.23
Unaffected versions =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

The affected functions from time 0.2.7 through 0.2.22 are:

  • time::UtcOffset::local_offset_at
  • time::UtcOffset::try_local_offset_at
  • time::UtcOffset::current_local_offset
  • time::UtcOffset::try_current_local_offset
  • time::OffsetDateTime::now_local
  • time::OffsetDateTime::try_now_local

The affected functions in time 0.1 (all versions) are:

  • at
  • at_utc
  • now

Non-Unix targets (including Windows and wasm) are unaffected.

Patches

Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.

Workarounds

No workarounds are known.

References

time-rs/time#293

See advisory page for additional details.

cargo check error with Features is private struct import

    Checking consulrs v0.1.0
error[E0603]: struct import `Features` is private
  --> /Users/suky/.cargo/registry/src/github.com-1ecc6299db9ec823/consulrs-0.1.0/src/client.rs:7:31
   |
7  |     api::{EndpointMiddleware, Features},
   |                               ^^^^^^^^ private struct import
   |
note: the struct import `Features` is defined here...
  --> /Users/suky/.cargo/registry/src/github.com-1ecc6299db9ec823/consulrs-0.1.0/src/api.rs:11:5
   |
11 | use crate::api::features::Features;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...and refers to the struct `Features` which is defined here
  --> /Users/suky/.cargo/registry/src/github.com-1ecc6299db9ec823/consulrs-0.1.0/src/api/features.rs:36:1
   |
36 | pub struct Features {
   | ^^^^^^^^^^^^^^^^^^^ consider importing it directly

For more information about this error, try `rustc --explain E0603`.
error: could not compile `consulrs` due to previous error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.