A/B test via cookie canary
, used for sticky sessions.
step0
- all traffic goes to backend
variant-b
, Kubernetes service-b-v1
apiVersion: zalando.org/v1
kind: RouteGroup
package main | |
import ( | |
"fmt" | |
"log" | |
"math" | |
"os" | |
"strconv" | |
"strings" | |
) |
import "lists" | |
// with checking circular references: | |
fn deepEq(...a) { | |
fn deepEq2Lists(refs, a, b) | |
len(a) == len(b) && | |
lists.every(fn(i) deepEq2(refs, a[i], b[i]), lists.indexes(a)) | |
fn deepEq2Structs(refs, a, b) | |
len(keys(a)) == len(keys(b)) && |
package main | |
import ( | |
"fmt" | |
"log" | |
) | |
/* | |
Project Euler #9: |
package routeswithfallback | |
import ( | |
"errors" | |
log "github.com/sirupsen/logrus" | |
"github.com/zalando/skipper/eskip" | |
"github.com/zalando/skipper/routing" | |
) |
package main | |
/* | |
This tool can be used to make hanging read or write requests. | |
To test: | |
skipper -inline-routes ' | |
read: Path("/read") -> randomContent(1000000000) -> <shunt>; | |
write: Path("/write") -> absorb() -> <shunt>; |
/* | |
This small POC shows a possible way to combine a config file with command line flags such that the command line | |
flags override the settings from the config file. | |
*/ | |
package main | |
import ( | |
"flag" | |
"log" | |
"os" |
This looks solid, nice job! Here's a code review, mostly stylistics.
the method name Matches
could be just simply Match
. (Somewhat following the regexp package as a convention.)
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |