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
//! ProxyService which does the actual work of the Proxy | |
use futures::future; | |
use http::header::HeaderMap; | |
use hyper::rt::Future; | |
use hyper::service::Service; | |
use hyper::{Body, Client, Method, Request, Response, StatusCode}; | |
use jsonwebtoken::{decode, TokenData, Validation}; | |
use log::{debug, error, trace, warn}; | |
use serde::{Deserialize, Serialize}; |
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
pub struct Context<'s>(&'s str); | |
struct Parser<'c, 's> { | |
context: &'c Context<'s>, | |
} | |
impl<'c, 's> Parser<'c, 's> { | |
fn parse(&self) -> Result<(), &'s str> { | |
Err(&self.context.0[1..]) | |
} |
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
use futures::future; | |
use hyper::rt::Future; | |
use hyper::service::{MakeService, Service}; | |
use hyper::{Body, Request, Response, Server, StatusCode}; | |
/// The service | |
pub struct TestService {} | |
impl Service for TestService { |
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
use futures::future; | |
use hyper::rt::Future; | |
use hyper::service::{NewService, Service}; | |
use hyper::{Body, Request, Response, Server, StatusCode}; | |
/// The service | |
pub struct TestService {} | |
impl Service for TestService { |
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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: wordpress-deployment | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: wordpress |
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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mariadb-deployment | |
spec: | |
selector: | |
matchLabels: | |
app: mariadb | |
template: |
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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
spec: | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
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
require "csv" | |
require "gzip" | |
MINIMUM_TIME = Time.parse_rfc3339("2017-11-02T00:00:00.000Z") | |
# process_file processes the .csv.gz files as a stream of bytes counting all records that | |
# meet the minimum date | |
def process_file(filename : String) : NamedTuple(total: Int32, matched: Int32) | |
puts "Processing: #{filename}" | |
total = 0 |
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
FROM ysbaddaden/crystal-alpine:0.24.1 as builder | |
RUN apk add openssl-dev yaml-dev nodejs | |
WORKDIR /src | |
COPY shard.* /src/ | |
RUN shards | |
COPY . /src | |
RUN rm -rf node_modules | |
RUN npm install | |
RUN crystal build src/hello.cr |
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
require "./spec_helper" | |
require "cossack" | |
require "http/client" | |
HI8.configure do |config| | |
config.cassette_library_dir = "./test_dir/cassettes" | |
end | |
describe Hi8test do | |
it "doesn't work using Cossack::Client" do |
NewerOlder