This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/printer" | |
"go/token" | |
"log" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"github.com/go-chi/chi" | |
"github.com/go-chi/render" | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
log "github.com/sirupsen/logrus" | |
"gopkg.in/olivere/elastic.v6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" | |
"os/signal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println!("listing subscriptions..."); | |
let subscriptions = list_subscriptions(&token).await?; | |
println!("subscriptions: {:?}", subscriptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Deserialize, Debug)] | |
struct SubscriptionsResponse { | |
subscriptions: Vec<Subscription>, | |
} | |
#[derive(Deserialize, Debug)] | |
struct Subscription { | |
id: String, | |
event: String, | |
target_url: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time entry was created with data: TrackingStoppedPayload { user_id: "1234", event_type: "trackingStopped", data: TrackingStoppedData { new_time_entry: Some(TimeEntry { id: "1234", activity: Activity { id: "1234", name: "Misc", color: "#17bbd2", integration: "zei", space_id: "1234", device_side: None }, duration: Duration { started_at: "2020-11-30T07:08:52.203", stopped_at: "2020-11-30T08:08:59.789" }, note: Note { text: None, tags: [], mentions: [] } }) } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tracking was started with data: TrackingStartedPayload { user_id: "1234", event_type: "trackingStarted", data: TrackingStartedData { current_tracking: Tracking { id: 1234, activity: Activity { id: "1234", name: "Misc", color: "#17bbd2", integration: "zei", space_id: "1234", device_side: None }, started_at: "2020-11-30T07:08:52.203", note: Note { text: None, tags: [], mentions: [] } } } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUBLIC_URL=the-url-from-localtunnel TMLR_API_KEY=secret TMLR_API_SECRET=secret cargo run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let health_route = warp::path!("health").and_then(health_handler); | |
warp::serve( | |
started_tracking_route | |
.or(stopped_tracking_route) | |
.or(health_route), | |
) | |
.run(([0, 0, 0, 0], 8000)) | |
.await; | |
Ok(()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Deserialize)] | |
#[serde(rename_all = "camelCase")] | |
struct TrackingStartedPayload { | |
user_id: String, | |
event_type: String, | |
data: TrackingStartedData, | |
} | |
#[derive(Debug, Deserialize)] | |
#[serde(rename_all = "camelCase")] |
NewerOlder