Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit 38b525c

Browse files
committed
Refactor2
1 parent 96c2745 commit 38b525c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2550
-1833
lines changed

.idea/workspace.xml

Lines changed: 49 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ require (
2424
github.com/stretchr/testify v1.4.0 // indirect
2525
github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df
2626
github.com/ungerik/pkgreflect v0.0.0-20170905122726-bfeb2a931863 // indirect
27+
github.com/zloylos/grsync v0.0.0-20200204095520-71a00a7141be
2728
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83
2829
golang.org/x/net v0.0.0-20190909003024-a7b16738d86b // indirect
2930
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ github.com/wplib/deploywp v0.0.0-20200506004903-e26a876beb4b/go.mod h1:cg0/t5kVr
123123
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
124124
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
125125
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
126+
github.com/zloylos/grsync v0.0.0-20200204095520-71a00a7141be h1:rT0BZrziodlFZ6tCEoqfL6HJdEiikZQRuNU2BDjItl0=
127+
github.com/zloylos/grsync v0.0.0-20200204095520-71a00a7141be/go.mod h1:2utuy8p4VcWXfB5p9wTL+VCberFM+MwTDjDf1nr8s78=
126128
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
127129
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
128130
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

jsonTemplate/helpers/deploywp/deploywp.go

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99

10-
type DeployWp struct {
10+
type TypeDeployWp struct {
1111
Hosts Hosts `json:"hosts"`
1212
Source Source `json:"source"`
1313
Target Target `json:"target"`
@@ -20,8 +20,9 @@ type DeployWp struct {
2020
type RuntimeMeta struct {
2121
}
2222

23-
func _NewJsonFile() *DeployWp {
24-
var jf DeployWp
23+
24+
func _NewJsonFile() *TypeDeployWp {
25+
var jf TypeDeployWp
2526

2627
jf.Hosts.New()
2728
jf.Source.New()
@@ -30,8 +31,8 @@ func _NewJsonFile() *DeployWp {
3031
return &jf
3132
}
3233

33-
func HelperLoadDeployWp(str interface{}) *DeployWp {
34-
var j DeployWp
34+
func HelperLoadDeployWp(str interface{}) *TypeDeployWp {
35+
var j TypeDeployWp
3536

3637
for range only.Once {
3738
j.Error = mapstructure.Decode(str, &j)
@@ -61,7 +62,7 @@ func HelperLoadDeployWp(str interface{}) *DeployWp {
6162
}
6263

6364

64-
func (me *DeployWp) IsNil() bool {
65+
func (me *TypeDeployWp) IsNil() bool {
6566
var ok bool
6667

6768
for range only.Once {
@@ -79,14 +80,14 @@ func (me *DeployWp) IsNil() bool {
7980

8081
// ////////////////////////////////////////////////////////////////////////////////
8182
// Source
82-
func (me *DeployWp) GetSource() *Source {
83+
func (me *TypeDeployWp) GetSource() *Source {
8384
return &me.Source
8485
}
8586

8687

8788
// ////////////////////////////////////////////////////////////////////////////////
8889
// Source.Paths
89-
func (me *DeployWp) GetSourcePaths() *Paths {
90+
func (me *TypeDeployWp) GetSourcePaths() *Paths {
9091
var ret *Paths
9192

9293
for range only.Once {
@@ -99,7 +100,7 @@ func (me *DeployWp) GetSourcePaths() *Paths {
99100

100101
return ret
101102
}
102-
//func (me *DeployWp) GetSourcePaths(abs ...interface{}) *Paths {
103+
//func (me *TypeDeployWp) GetSourcePaths(abs ...interface{}) *Paths {
103104
// var ret *Paths
104105
//
105106
// for range only.Once {
@@ -120,7 +121,7 @@ func (me *DeployWp) GetSourcePaths() *Paths {
120121
//
121122
// return ret
122123
//}
123-
func (me *DeployWp) GetSourceAbsPaths() *Paths {
124+
func (me *TypeDeployWp) GetSourceAbsPaths() *Paths {
124125
var ret *Paths
125126

126127
for range only.Once {
@@ -137,7 +138,7 @@ func (me *DeployWp) GetSourceAbsPaths() *Paths {
137138

138139
// ////////////////////////////////////////////////////////////////////////////////
139140
// Source.Repository
140-
func (me *DeployWp) GetSourceRepositoryProvider() string {
141+
func (me *TypeDeployWp) GetSourceRepositoryProvider() string {
141142
var ret string
142143

143144
for range only.Once {
@@ -150,7 +151,7 @@ func (me *DeployWp) GetSourceRepositoryProvider() string {
150151

151152
return ret
152153
}
153-
func (me *DeployWp) GetSourceRepositoryUrl() URL {
154+
func (me *TypeDeployWp) GetSourceRepositoryUrl() URL {
154155
var ret URL
155156

156157
for range only.Once {
@@ -167,7 +168,7 @@ func (me *DeployWp) GetSourceRepositoryUrl() URL {
167168

168169
// ////////////////////////////////////////////////////////////////////////////////
169170
// Source.Revision
170-
func (me *DeployWp) GetSourceRevisionType() string {
171+
func (me *TypeDeployWp) GetSourceRevisionType() string {
171172
var ret string
172173

173174
for range only.Once {
@@ -180,7 +181,7 @@ func (me *DeployWp) GetSourceRevisionType() string {
180181

181182
return ret
182183
}
183-
func (me *DeployWp) GetSourceRevisionName() string {
184+
func (me *TypeDeployWp) GetSourceRevisionName() string {
184185
var ret string
185186

186187
for range only.Once {
@@ -197,7 +198,7 @@ func (me *DeployWp) GetSourceRevisionName() string {
197198

198199
// ////////////////////////////////////////////////////////////////////////////////
199200
// Source.Build
200-
func (me *DeployWp) GetSourceBuild() bool {
201+
func (me *TypeDeployWp) GetSourceBuild() bool {
201202
var ret bool
202203

203204
for range only.Once {
@@ -214,14 +215,14 @@ func (me *DeployWp) GetSourceBuild() bool {
214215

215216
// ////////////////////////////////////////////////////////////////////////////////
216217
// Target
217-
func (me *DeployWp) GetTarget() *Target {
218+
func (me *TypeDeployWp) GetTarget() *Target {
218219
return &me.Target
219220
}
220221

221222

222223
// ////////////////////////////////////////////////////////////////////////////////
223224
// Target.Files
224-
func (me *DeployWp) GetTargetFiles(ftype interface{}) *FilesArray {
225+
func (me *TypeDeployWp) GetTargetFiles(ftype interface{}) *FilesArray {
225226
var ret *FilesArray
226227

227228
for range only.Once {
@@ -238,7 +239,7 @@ func (me *DeployWp) GetTargetFiles(ftype interface{}) *FilesArray {
238239

239240
// ////////////////////////////////////////////////////////////////////////////////
240241
// Target.Paths
241-
func (me *DeployWp) GetTargetPaths() *Paths {
242+
func (me *TypeDeployWp) GetTargetPaths() *Paths {
242243
var ret *Paths
243244

244245
for range only.Once {
@@ -251,7 +252,7 @@ func (me *DeployWp) GetTargetPaths() *Paths {
251252

252253
return ret
253254
}
254-
func (me *DeployWp) GetTargetAbsPaths() *Paths {
255+
func (me *TypeDeployWp) GetTargetAbsPaths() *Paths {
255256
var ret *Paths
256257

257258
for range only.Once {
@@ -268,7 +269,7 @@ func (me *DeployWp) GetTargetAbsPaths() *Paths {
268269

269270
// ////////////////////////////////////////////////////////////////////////////////
270271
// Target.Revisions
271-
func (me *DeployWp) GetTargetRevision(host interface{}) *TargetRevision {
272+
func (me *TypeDeployWp) GetTargetRevision(host interface{}) *TargetRevision {
272273
var ret *TargetRevision
273274

274275
for range only.Once {
@@ -285,7 +286,7 @@ func (me *DeployWp) GetTargetRevision(host interface{}) *TargetRevision {
285286

286287
// ////////////////////////////////////////////////////////////////////////////////
287288
// Target.Providers
288-
func (me *DeployWp) GetTargetProvider(provider interface{}) *Provider {
289+
func (me *TypeDeployWp) GetTargetProvider(provider interface{}) *Provider {
289290
var ret *Provider
290291

291292
for range only.Once {
@@ -302,11 +303,11 @@ func (me *DeployWp) GetTargetProvider(provider interface{}) *Provider {
302303

303304
// ////////////////////////////////////////////////////////////////////////////////
304305
// Hosts
305-
func (me *DeployWp) GetHosts() *Hosts {
306+
func (me *TypeDeployWp) GetHosts() *Hosts {
306307
return &me.Hosts
307308
}
308309

309-
func (me *DeployWp) GetHost(host interface{}) *Host {
310+
func (me *TypeDeployWp) GetHost(host interface{}) *Host {
310311
var ret *Host
311312

312313
for range only.Once {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package deploywp
2+
3+
type HelperDeployWp TypeDeployWp
4+
func (me *HelperDeployWp) Reflect() *TypeDeployWp {
5+
return (*TypeDeployWp)(me)
6+
}

jsonTemplate/helpers/deploywp/pkgreflect.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package deploywp
2+
3+
import "github.com/wplib/deploywp/ux"
4+
5+
6+
type DeployWpGetter interface {
7+
}
8+
9+
10+
type State ux.State
11+
func (p *State) Reflect() *ux.State {
12+
return (*ux.State)(p)
13+
}

jsonTemplate/helpers/helperPath/copy.go renamed to jsonTemplate/helpers/helperCopy/copy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package helperFile
1+
package helperCopy
22

33
import (
44
"github.com/wplib/deploywp/only"
55
"github.com/wplib/deploywp/ux"
66
"os"
77
)
88

9+
910
func (p *TypeOsPath) Copy() *State {
1011
for range only.Once {
1112
if !p._IsValid() {

0 commit comments

Comments
 (0)