-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xml
88 lines (73 loc) · 5.86 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>SlashQuery /?</title>
<link>https://slashquery.com/</link>
<description>Recent content on SlashQuery /?</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Sat, 03 Jun 2017 09:58:25 +0200</lastBuildDate>
<atom:link href="https://slashquery.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Microservices using an API Gateway.</title>
<link>https://slashquery.com/post/microservices-using-an-api-gateway/</link>
<pubDate>Sat, 03 Jun 2017 09:58:25 +0200</pubDate>
<guid>https://slashquery.com/post/microservices-using-an-api-gateway/</guid>
<description>The big picture:
(slashquery API Gateway) api.example.com/&lt;path endpoint&gt; | (plugins) (upstream) (microservices) | /home | /* &gt;--[middleware]---[LoadBalancer]--&lt; /home | /home | | /foo | /foo/* &gt;--[middleware]---[LoadBalancer]--&lt; /foo | /foo | | /foo-version-2 (versioning) | /foo/* &gt;--[middleware]---[LoadBalancer]--&lt; /foo-version-2 | /foo-version-2 | | /bar ` /bar/* &gt;--[middleware]---[LoadBalancer]--&lt; /bar /bar More about versioning: https://violetear.org/post/versioning/
The configuration file in YAML format:
config: host: ~ # listen all IP's port: 80 resolver: 8.</description>
</item>
<item>
<title>Build your API Gateway</title>
<link>https://slashquery.com/post/build-your-api-gateway/</link>
<pubDate>Sat, 03 Jun 2017 09:57:24 +0200</pubDate>
<guid>https://slashquery.com/post/build-your-api-gateway/</guid>
<description>Because of the plugins (middleware) is not possible to have a generic binary, therefore after creating the configuration file and based on the plugins defined the gateway needs to be build.
Setup Setup go environment https://golang.org/doc/install
go &gt;= 1.7 is required
For example using $HOME/go for your workspace
export GOPATH=$HOME/go Create the directory:
mkdir -p $HOME/go/src/github.com/slashquery Clone project into that directory:
git clone [email protected]:slashquery/slashquery.git $HOME/go/src/github.com/slashquery/slashquery Create your configuration file and type make CONFIG=/path/to/slashquery.</description>
</item>
<item>
<title>The configuration file</title>
<link>https://slashquery.com/post/slashquery-yaml/</link>
<pubDate>Sat, 03 Jun 2017 09:57:23 +0200</pubDate>
<guid>https://slashquery.com/post/slashquery-yaml/</guid>
<description>The configuration file is composed of 3 sections:
config routes upstreams plugins Example:
config: socket: /tmp/slashquery.sock routes: get: path: /get upstream: httpbin methods: - GET plugins: - waf upstream: httpbin: timeout: 5 servers: - httpbin.org plugins: waf: [&quot;github.com/slashquery-plugins/waf&quot;, &quot;waf.WAF&quot;] The config allow the following options:
debug host port request-id resolver socket </description>
</item>
<item>
<title>Plugins</title>
<link>https://slashquery.com/post/plugins/</link>
<pubDate>Sat, 03 Jun 2017 09:56:24 +0200</pubDate>
<guid>https://slashquery.com/post/plugins/</guid>
<description>Plugins are handlers that satisfy the http.Handler.
They are declared in the routes section of the configuration file for example:
routes: foo: url: http://foo.example.com plugins: # the order of the plugins meters - requestid - waf - cors - prometheus plugins: cors: [&quot;github.com/slashquery-plugins/cors&quot;, &quot;cors.CORS&quot;] csrf: [&quot;github.com/slashquery-plugins/csrf&quot;, &quot;csrf.CSRF&quot;] prometheus: [&quot;github.com/slashquery-plugins/prometheus&quot;, &quot;prometheus.Prometheus&quot;] requestid: [&quot;github.com/slashquery-plugins/requestid&quot;, &quot;requestid.RequestID&quot;] waf: [&quot;github.com/slashquery-plugins/waf&quot;, &quot;waf.WAF&quot;] The plugins section is a list of plugins each of one defined within a list, for example:</description>
</item>
<item>
<title>Using Nginx and slashquery through unix socket</title>
<link>https://slashquery.com/post/nginx-and-slashquery-through-unix-socket/</link>
<pubDate>Sat, 03 Jun 2017 09:56:23 +0200</pubDate>
<guid>https://slashquery.com/post/nginx-and-slashquery-through-unix-socket/</guid>
<description>Nginx configuration:
upstream slashquery { server unix:/tmp/slashquery.sock; keepalive 60; } server { listen 80 default_server; listen [::]:80 default_server; server_name _; location / { proxy_pass http://slashquery; proxy_http_version 1.1; # for keep-alive proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } } SlashQuery configuration:
config: socket: /tmp/slashquery.sock ... When socket is defined host and port are ignored.</description>
</item>
<item>
<title>SlashQuery /?</title>
<link>https://slashquery.com/about/</link>
<pubDate>Sun, 21 May 2017 22:52:45 +0200</pubDate>
<guid>https://slashquery.com/about/</guid>
<description> What is slashquery ? A pluggable API Gateway
In a nutshell is an HTTP reverse proxy that pre-processes the requests before they arrive at their final destination based on custom plugins.
Some features:
Single binary. Loads configuration from a YAML file. Allows the use of 3rd party handlers (plugins) that satisfy the http.Handler. DNS resolver honoring TTL from the upstream. Load balancer (round robin). Versioning Accept: application/vnd.* Accept or reject(405) based on HTTP Request Methods </description>
</item>
</channel>
</rss>