Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
use sqlite for cache too
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Oct 30, 2018
1 parent 9ab6a9b commit 68c6341
Show file tree
Hide file tree
Showing 11 changed files with 323 additions and 107 deletions.
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ flatbuffers = { path = "./third_party/flatbuffers/rust/flatbuffers" }
hyper = "0.12"
hyper-tls = "0.3"
http = "0.1"
rusqlite = {version="0.14", features=["bundled"]}
rusqlite = {version="0.15", features=["bundled","blob"]}
r2d2 = "0.8"
r2d2_sqlite = "0.6"
r2d2_sqlite = "0.7"
r2d2_redis = "0.8"
sha2 = "0.7"
sha-1 = "0.7"
Expand All @@ -28,9 +28,9 @@ sourcemap = "2.2"
rand = "0.5"
libfly = { path = "libfly" }
tokio-udp = "0.1"
trust-dns-server = "0.15.0-alpha.2"
trust-dns = "0.15.0-alpha.2"
trust-dns-proto = "0.5.0-alpha.3"
trust-dns-server = { git = "https://github.com/bluejekyll/trust-dns", rev = "dc133e91c4d1461aece3ddcb9525dce824d2baa1" }
trust-dns = { git = "https://github.com/bluejekyll/trust-dns", rev = "dc133e91c4d1461aece3ddcb9525dce824d2baa1" }
trust-dns-proto = { git = "https://github.com/bluejekyll/trust-dns", rev = "dc133e91c4d1461aece3ddcb9525dce824d2baa1" }
tokio-fs = "0.1"
tokio-codec = "0.1"
glob = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ addEventListener("resolv", event => {
name: event.request.queries[0].name, // name of the DNS entry
rrType: DNSRecordType.A, // record type
ttl: 300, // time-to-live for the client
data: "127.0.0.1" // data for the record
data: {ip: "127.0.0.1"} // data for the record
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion hello-world.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ addEventListener("fetch", function (event) {
event.respondWith(new Response(helloWorld))

else if (url.pathname == "/kitchensink") {
const coll = flyData.collection("testing")
const coll = fly.data.collection("testing")
coll.put("id", { foo: "bar" }).then(b => {
console.log("put returned:", b);
coll.get("id").then(d => {
Expand Down
3 changes: 2 additions & 1 deletion src/bin/dns/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern crate trust_dns_server;
use trust_dns_server::authority::{AuthLookup, MessageResponseBuilder};

use trust_dns_proto::op::header::Header;
use trust_dns_proto::rr::record_type::RecordType;
use trust_dns_proto::rr::{Record, RrsetRecords};
use trust_dns_server::authority::authority::LookupRecords;

Expand Down Expand Up @@ -123,7 +124,7 @@ impl RequestHandler for DnsHandler {
.iter()
.map(|q| {
debug!("query: {:?}", q);
use self::dns::rr::{DNSClass, Name, RecordType};
use self::dns::rr::{DNSClass, Name};
let name = builder.create_string(&Name::from(q.name().clone()).to_utf8());
let rr_type = match q.query_type() {
RecordType::A => msg::DnsRecordType::A,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ pub mod msg;
pub mod ops;
pub mod redis_stream;
pub mod runtime;
mod sqlite_cache;
pub mod utils;
Loading

0 comments on commit 68c6341

Please sign in to comment.