|
@@ -17,6 +17,7 @@ package v1
|
|
import (
|
|
import (
|
|
"bytes"
|
|
"bytes"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
|
+ "errors"
|
|
"fmt"
|
|
"fmt"
|
|
"reflect"
|
|
"reflect"
|
|
)
|
|
)
|
|
@@ -42,7 +43,7 @@ func (c *TypedClientPluginOptions) UnmarshalJSON(b []byte) error {
|
|
|
|
|
|
c.Type = typeStruct.Type
|
|
c.Type = typeStruct.Type
|
|
if c.Type == "" {
|
|
if c.Type == "" {
|
|
- return nil
|
|
|
|
|
|
+ return errors.New("plugin type is empty")
|
|
}
|
|
}
|
|
|
|
|
|
v, ok := clientPluginOptionsTypeMap[typeStruct.Type]
|
|
v, ok := clientPluginOptionsTypeMap[typeStruct.Type]
|
|
@@ -63,6 +64,10 @@ func (c *TypedClientPluginOptions) UnmarshalJSON(b []byte) error {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func (c *TypedClientPluginOptions) MarshalJSON() ([]byte, error) {
|
|
|
|
+ return json.Marshal(c.ClientPluginOptions)
|
|
|
|
+}
|
|
|
|
+
|
|
const (
|
|
const (
|
|
PluginHTTP2HTTPS = "http2https"
|
|
PluginHTTP2HTTPS = "http2https"
|
|
PluginHTTPProxy = "http_proxy"
|
|
PluginHTTPProxy = "http_proxy"
|