Commit 3235b4b 1 parent 568066e commit 3235b4b Copy full SHA for 3235b4b
File tree 5 files changed +14
-22
lines changed
5 files changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ func saveResponseAndConvert() {
63
63
64
64
var AccessToken = config .FetchAndValidate ("AccessToken" ) // returns string
65
65
66
+ var PullURL = config .DevnagriURL + "/project/pull"
67
+
66
68
resp , err := resty .R ().
67
69
SetHeader ("Accept" , "application/json" ).
68
70
SetHeader ("Content-Type" , "multipart/form-data" ).
@@ -71,7 +73,7 @@ func saveResponseAndConvert() {
71
73
"client_id" : ClientID ,
72
74
"client_secret" : ClientSecret ,
73
75
"project_key" : ProjectKey }).
74
- Post ("http://dev.devnagri.co.in/api/project/pull" )
76
+ Post (PullURL )
75
77
76
78
if err != nil {
77
79
panic (err )
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ func listAllFilesAndPush() {
67
67
68
68
var Extension = config .FetchAndValidate ("Extension" )
69
69
70
+ var PushURL = config .DevnagriURL + "/project/push"
71
+
70
72
resp , err := resty .R ().
71
73
SetHeader ("Accept" , "application/json" ).
72
74
SetHeader ("Content-Type" , "multipart/form-data" ).
@@ -81,7 +83,7 @@ func listAllFilesAndPush() {
81
83
"file[0][file_type]" : "xml" ,
82
84
"file[0][location]" : filename ,
83
85
}).
84
- Post ("http://dev.devnagri.co.in/api/project/push" )
86
+ Post (PushURL )
85
87
86
88
if err != nil {
87
89
panic (err )
Original file line number Diff line number Diff line change @@ -64,14 +64,16 @@ func fetchStatus() {
64
64
65
65
var AccessToken = config .FetchAndValidate ("AccessToken" ) // returns string
66
66
67
+ var StatusURL = config .DevnagriURL + "/project/status"
68
+
67
69
resp , err := resty .R ().
68
70
SetHeader ("Accept" , "application/json" ).
69
71
SetAuthToken (AccessToken ).
70
72
SetFormData (map [string ]string {
71
73
"client_id" : ClientID ,
72
74
"client_secret" : ClientSecret ,
73
75
"project_key" : ProjectKey }).
74
- Post ("http://dev.devnagri.co.in/api/project/status" )
76
+ Post (StatusURL )
75
77
76
78
if err != nil {
77
79
panic (err )
@@ -124,8 +126,7 @@ func fetchStatus() {
124
126
fmt .Println ("totalWordsCount : " , totalWordsCount )
125
127
fmt .Println ("translatedWordsCount : " , translatedWordsCount )
126
128
127
-
128
- //TODO: Do some maths here to print out the percentage
129
+ //TODO: Do some maths here to print out the percentage
129
130
/*
130
131
for _, y := range valChildren {
131
132
fmt.Println("\n", y)
Original file line number Diff line number Diff line change @@ -58,14 +58,15 @@ func validate() {
58
58
59
59
var ProjectKey = config .FetchAndValidate ("ProjectKey" ) // returns string
60
60
61
+ var ValidateURL = config .DevnagriURL + "/project/validations"
62
+
61
63
resp , err := resty .R ().
62
64
SetHeader ("Content-Type" , "multipart/form-data" ).
63
65
SetFormData (map [string ]string {
64
66
"client_id" : ClientID ,
65
67
"client_secret" : ClientSecret ,
66
68
"project_key" : ProjectKey }).
67
- Post ("http://dev.devnagri.co.in/api/key/validations" )
68
- // Post("http://192.168.60.10/api/key/validations")
69
+ Post (ValidateURL )
69
70
70
71
if err != nil {
71
72
panic (err )
Original file line number Diff line number Diff line change @@ -27,18 +27,4 @@ func FetchAndValidate(fieldName string) string {
27
27
28
28
}
29
29
30
- /*
31
- var ClientID = fetchAndValidate("ClientID") // returns string
32
-
33
- var ClientSecret = fetchAndValidate("ClientSecret") // returns string
34
-
35
- var ProjectKey = fetchAndValidate("ProjectKey") // returns string
36
-
37
- var RootDir = fetchAndValidate("RootDir") // returns string
38
-
39
- var SourceLanguage = fetchAndValidate("SourceLanguage") // returns string
40
-
41
- var TargetLanguages = fetchAndValidate("TargetLanguages") // returns string
42
-
43
- var GlobalPreferenceInCaseOfMergeConflict = fetchAndValidate("GlobalPreferenceInCaseOfMergeConflict") // returns string
44
- */
30
+ var DevnagriURL = "http://dev.devnagri.co.in/api"
You can’t perform that action at this time.
0 commit comments