Skip to content

Commit 54ff9d0

Browse files
godoc: reformat all sources with gofmt 1.19 (zalando#2074)
* godoc: reformat all sources with gofmt 1.19 `gofmt` misinterprets code blocks of `eskip` examples starting with `*` as a bullet list. This change adds route id to all such eskip examples such that subsequent reformatting with gofmt 1.18 and 1.19 does not produce any changes. Signed-off-by: Alexander Yastrebov <[email protected]> * ignore statickcheck error Signed-off-by: Alexander Yastrebov <[email protected]> Signed-off-by: Alexander Yastrebov <[email protected]>
1 parent 8b7cd03 commit 54ff9d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+754
-862
lines changed

circuit/doc.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ The circuit breakers are always assigned to backend hosts, so that the outcome o
99
affects the circuit breaker behavior of another host. Besides hosts, individual routes can have separate circuit
1010
breakers, too.
1111
12-
Breaker Type - Consecutive Failures
12+
# Breaker Type - Consecutive Failures
1313
1414
This breaker opens when the proxy couldn't connect to a backend or received a >=500 status code at least N times
1515
in a row. When open, the proxy returns 503 - Service Unavailable response during the breaker timeout. After this
1616
timeout, the breaker goes into half-open state, in which it expects that M number of requests succeed. The
1717
requests in the half-open state are accepted concurrently. If any of the requests during the half-open state
1818
fails, the breaker goes back to open state. If all succeed, it goes to closed state again.
1919
20-
Breaker Type - Failure Rate
20+
# Breaker Type - Failure Rate
2121
2222
The "rate breaker" works similar to the "consecutive breaker", but instead of considering N consecutive failures
2323
for going open, it maintains a sliding window of the last M events, both successes and failures, and opens only
2424
when the number of failures reaches N within the window. This way the sliding window is not time based and
2525
allows the same breaker characteristics for low and high rate traffic.
2626
27-
Usage
27+
# Usage
2828
2929
When imported as a package, the Registry can be used to hold the circuit breakers and their settings. On a
3030
higher level, the circuit breaker settings can be simply passed to skipper as part of the skipper.Options
@@ -63,54 +63,54 @@ Setting global values happens the same way as setting host values, but leaving t
6363
route based values happens with filters in the route definitions.
6464
(https://godoc.org/github.com/zalando/skipper/filters/circuit)
6565
66-
Settings - Type
66+
# Settings - Type
6767
6868
It can be ConsecutiveFailures, FailureRate or Disabled, where the first two values select which breaker to use,
6969
while the Disabled value can override a global or host configuration disabling the circuit breaker for the
7070
specific host or route.
7171
7272
Command line name: type. Possible command line values: consecutive, rate, disabled.
7373
74-
Settings - Host
74+
# Settings - Host
7575
7676
The Host field indicates to which backend host should the current set of settings be applied. Leaving it empty
7777
indicates global settings.
7878
7979
Command line name: host.
8080
81-
Settings - Window
81+
# Settings - Window
8282
8383
The window value sets the size of the sliding counter window of the failure rate breaker.
8484
8585
Command line name: window. Possible command line values: any positive integer.
8686
87-
Settings - Failures
87+
# Settings - Failures
8888
8989
The failures value sets the max failure count for both the "consecutive" and "rate" breakers.
9090
9191
Command line name: failures. Possible command line values: any positive integer.
9292
93-
Settings - Timeout
93+
# Settings - Timeout
9494
9595
With the timeout we can set how long the breaker should stay open, before becoming half-open.
9696
9797
Command line name: timeout. Possible command line values: any positive integer as milliseconds or a duration
9898
string, e.g. 15m30s.
9999
100-
Settings - Half-Open Requests
100+
# Settings - Half-Open Requests
101101
102102
Defines the number of requests expected to succeed while the circuit breaker is in the half-open state.
103103
104104
Command line name: half-open-requests. Possible command line values: any positive integer.
105105
106-
Settings - Idle TTL
106+
# Settings - Idle TTL
107107
108108
Defines the idle timeout after which a circuit breaker gets recycled, if it hasn't been used.
109109
110110
Command line name: idle-ttl. Possible command line values: any positive integer as milliseconds or a duration
111111
string, e.g. 15m30s.
112112
113-
Filters
113+
# Filters
114114
115115
The following circuit breaker filters are supported: consecutiveBreaker(), rateBreaker() and disableBreaker().
116116
@@ -129,7 +129,7 @@ route that it appears in.
129129
130130
disableBreaker()
131131
132-
Proxy Usage
132+
# Proxy Usage
133133
134134
The proxy, when circuit breakers are configured, uses them for backend connections. It checks the breaker for
135135
the current backend host if it's closed before making backend requests. It reports the outcome of the request to
@@ -139,7 +139,7 @@ breaker is open, the proxy doesn't try to make backend requests, and returns a r
139139
140140
X-Circuit-Open: true
141141
142-
Registry
142+
# Registry
143143
144144
The active circuit breakers are stored in a registry. They are created on-demand, for the requested settings.
145145
The registry synchronizes access to the shared circuit breakers. When the registry detects that a circuit

circuit/registry.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (r *Registry) get(s BreakerSettings) *Breaker {
9696
// Get returns a circuit breaker for the provided settings. The BreakerSettings object is used here as a key,
9797
// but typically it is enough to just set its Host field:
9898
//
99-
// r.Get(BreakerSettings{Host: backendHost})
99+
// r.Get(BreakerSettings{Host: backendHost})
100100
//
101101
// The key will be filled up with the defaults and the matching circuit breaker will be returned if it exists,
102102
// or a new one will be created if not.

cmd/eskip/doc.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@ formatted routes from and to different data sources.
1818
1919
For command line help, enter:
2020
21-
eskip -help
21+
eskip -help
2222
23-
Examples
23+
# Examples
2424
2525
Check if an eskip file has valid syntax:
2626
27-
eskip check routes.eskip
27+
eskip check routes.eskip
2828
2929
Print routes stored in etcd:
3030
31-
eskip print -etcd-urls https://etcd.example.org
31+
eskip print -etcd-urls https://etcd.example.org
3232
3333
Print routes as JSON:
3434
35-
eskip print -json
35+
eskip print -json
3636
3737
Insert/update routes in etcd from an eskip file:
3838
39-
eskip upsert routes.eskip
39+
eskip upsert routes.eskip
4040
4141
Sync routes from an eskip file to etcd:
4242
43-
eskip reset routes.eskip
43+
eskip reset routes.eskip
4444
4545
Delete routes from etcd:
4646
47-
eskip delete -ids route1,route2,route3
47+
eskip delete -ids route1,route2,route3
4848
4949
Delete all routes from etcd:
5050
51-
eskip print | eskip delete
51+
eskip print | eskip delete
5252
5353
Copy all routes in etcd under a different prefix:
5454
55-
eskip print | eskip upsert -etcd-prefix /skipper-backup
55+
eskip print | eskip upsert -etcd-prefix /skipper-backup
5656
5757
(Where -etcd-urls is not set for write operations like upsert, reset and
5858
delete, the default etcd cluster urls are used:

cmd/skipper/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set of filters.
44
55
For the list of command line options, run:
66
7-
skipper -help
7+
skipper -help
88
99
For details about the usage and extensibility of skipper, please see the
1010
documentation of the root skipper package.

dataclients/kubernetes/clusterclient.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ func newClusterClient(o Options, apiURL, ingCls, rgCls string, quit <-chan struc
194194

195195
// serializes a given map of label selectors to a string that can be appended to a request URI to kubernetes
196196
// Examples (note that the resulting value in the query is URL escaped, for readability this is not done in examples):
197-
// [] becomes ``
198-
// ["label": ""] becomes `?labelSelector=label`
199-
// ["label": "value"] becomes `?labelSelector=label=value`
200-
// ["label": "value", "label2": "value2"] becomes `?labelSelector=label=value&label2=value2`
197+
//
198+
// [] becomes ``
199+
// ["label": ""] becomes `?labelSelector=label`
200+
// ["label": "value"] becomes `?labelSelector=label=value`
201+
// ["label": "value", "label2": "value2"] becomes `?labelSelector=label=value&label2=value2`
201202
func toLabelSelectorQuery(selectors map[string]string) string {
202203
if len(selectors) == 0 {
203204
return ""
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/* Package definitions provides type definitions, parsing, marshaling and
2-
validation for Kubernetes resources used by Skipper. */
1+
// Package definitions provides type definitions, parsing, marshaling and
2+
// validation for Kubernetes resources used by Skipper.
33
package definitions

0 commit comments

Comments
 (0)