Add: fallback policy group

This commit is contained in:
Dreamacro
2018-09-26 00:34:15 +08:00
parent 3e68faecb2
commit 220e4f0608
4 changed files with 169 additions and 0 deletions

View File

@ -37,6 +37,11 @@ type URLTest struct {
Now string `json:"now"`
}
type Fallback struct {
Type string `json:"type"`
Now string `json:"now"`
}
func transformProxy(proxy C.Proxy) interface{} {
t := proxy.Type()
switch t {
@ -52,6 +57,11 @@ func transformProxy(proxy C.Proxy) interface{} {
Type: t.String(),
Now: proxy.(*A.URLTest).Now(),
}
case C.Fallback:
return Fallback{
Type: t.String(),
Now: proxy.(*A.Fallback).Now(),
}
default:
return SampleProxy{
Type: proxy.Type().String(),