Skip to content

Commit

Permalink
config: inline is NOT SUPPORTED in encoding/json (fatedier#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
fakeboboliu authored Mar 19, 2021
1 parent bed13d7 commit 1a11b28
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// recommended to use GetDefaultClientConf instead of creating this object
// directly, so that all unspecified fields have reasonable default values.
type ClientCommonConf struct {
auth.ClientConfig `ini:",extends" json:"inline"`
auth.ClientConfig `ini:",extends"`

// ServerAddr specifies the address of the server to connect to. By
// default, this value is "0.0.0.0".
Expand Down
26 changes: 13 additions & 13 deletions pkg/config/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ type BaseProxyConf struct {
Metas map[string]string `ini:"-" json:"metas"`

// TODO: LocalSvrConf => LocalAppConf
LocalSvrConf `ini:",extends" json:"inline"`
HealthCheckConf `ini:",extends" json:"inline"`
LocalSvrConf `ini:",extends"`
HealthCheckConf `ini:",extends"`
}

type DomainConf struct {
Expand All @@ -155,8 +155,8 @@ type DomainConf struct {

// HTTP
type HTTPProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
DomainConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`
DomainConf `ini:",extends"`

Locations []string `ini:"locations" json:"locations"`
HTTPUser string `ini:"http_user" json:"http_user"`
Expand All @@ -167,50 +167,50 @@ type HTTPProxyConf struct {

// HTTPS
type HTTPSProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
DomainConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`
DomainConf `ini:",extends"`
}

// TCP
type TCPProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`
RemotePort int `ini:"remote_port" json:"remote_port"`
}

// TCPMux
type TCPMuxProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
DomainConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`
DomainConf `ini:",extends"`

Multiplexer string `ini:"multiplexer"`
}

// STCP
type STCPProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`

Role string `ini:"role" json:"role"`
Sk string `ini:"sk" json:"sk"`
}

// XTCP
type XTCPProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`

Role string `ini:"role" json:"role"`
Sk string `ini:"sk" json:"sk"`
}

// UDP
type UDPProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`

RemotePort int `ini:"remote_port" json:"remote_port"`
}

// SUDP
type SUDPProxyConf struct {
BaseProxyConf `ini:",extends" json:"inline"`
BaseProxyConf `ini:",extends"`

Role string `ini:"role" json:"role"`
Sk string `ini:"sk" json:"sk"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// recommended to use GetDefaultServerConf instead of creating this object
// directly, so that all unspecified fields have reasonable default values.
type ServerCommonConf struct {
auth.ServerConfig `ini:",extends" json:"inline"`
auth.ServerConfig `ini:",extends"`

// BindAddr specifies the address that the server binds to. By default,
// this value is "0.0.0.0".
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ type BaseVisitorConf struct {
}

type SUDPVisitorConf struct {
BaseVisitorConf `ini:",extends" json:"inline"`
BaseVisitorConf `ini:",extends"`
}

type STCPVisitorConf struct {
BaseVisitorConf `ini:",extends" json:"inline"`
BaseVisitorConf `ini:",extends"`
}

type XTCPVisitorConf struct {
BaseVisitorConf `ini:",extends" json:"inline"`
BaseVisitorConf `ini:",extends"`
}

// DefaultVisitorConf creates a empty VisitorConf object by visitorType.
Expand Down

0 comments on commit 1a11b28

Please sign in to comment.