From 5ef4144e7253963589437728c7022d24bbde121a Mon Sep 17 00:00:00 2001 From: zu1k Date: Sat, 5 Sep 2020 11:24:09 +0800 Subject: [PATCH] =?UTF-8?q?expose=20country=20and=20useable=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/proxy/base.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pkg/proxy/base.go b/pkg/proxy/base.go index 14f3510..70105f0 100644 --- a/pkg/proxy/base.go +++ b/pkg/proxy/base.go @@ -6,8 +6,8 @@ type Base struct { Port int `yaml:"port" json:"port"` Type string `yaml:"type" json:"type"` UDP bool `yaml:"udp,omitempty" json:"udp,omitempty"` - country string `yaml:"country,omitempty" json:"country,omitempty"` - useable bool `yaml:"useable,omitempty" json:"useable,omitempty"` + Country string `yaml:"country,omitempty" json:"country,omitempty"` + Useable bool `yaml:"useable,omitempty" json:"useable,omitempty"` } func (b *Base) TypeName() string { @@ -35,19 +35,11 @@ func (b *Base) Clone() Base { } func (b *Base) SetUseable(useable bool) { - b.useable = useable -} - -func (b *Base) Useable() bool { - return b.useable + b.Useable = useable } func (b *Base) SetCountry(country string) { - b.country = country -} - -func (b *Base) Country() string { - return b.country + b.Country = country } type Proxy interface { @@ -62,7 +54,5 @@ type Proxy interface { BaseInfo() *Base Clone() Proxy SetUseable(useable bool) - Useable() bool SetCountry(country string) - Country() string }