-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gene Gleyzer
committed
Nov 19, 2024
1 parent
ab9a4d9
commit 2e9f272
Showing
2 changed files
with
39 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,46 @@ | ||
module TestSimple { | ||
|
||
package json import json.xtclang.org; | ||
|
||
@Inject Console console; | ||
|
||
import json.*; | ||
|
||
void run() { | ||
|
||
Test t = new Test(); | ||
console.print(t.getObject()); | ||
console.print(t.getDoc()); | ||
|
||
} | ||
|
||
service Test { | ||
|
||
JsonObject getObject(Int i = 1) { | ||
JsonObject o = json.newObject(); | ||
o["a"] = i /*this will not be needed*/.toIntLiteral(); | ||
return o; // no need to freeze | ||
} | ||
|
||
Doc getDoc(Dec d = 1) { | ||
JsonObject o = json.newObject(); | ||
o["a"] = d /*this will not be needed*/.toFPLiteral(); | ||
return o; | ||
} | ||
JsonObject o = json.newObject([ | ||
"status" = json.newObject([ | ||
"hostIP" = "10.0.10.4", | ||
"hostIPs" = [ | ||
["ip" = "10.0.10.4"] | ||
], | ||
"conditions" = [ | ||
json.newObject([ | ||
"lastProbeTime" = Null, | ||
"lastTransitionTime" = "2024-11-18T15:26:00Z", | ||
"status" = False, | ||
"type" = "PodReadyToStartContainers" | ||
]), | ||
json.newObject([ | ||
"lastProbeTime" = Null, | ||
"lastTransitionTime" = "2024-11-18T15:26:00Z", | ||
"message" = "containers with incomplete status: [coherence-k8s-utils]", | ||
"reason" = "ContainersNotInitialized", | ||
"status" = "False", | ||
"type" = "Initialized" | ||
]), | ||
], | ||
"containerStatuses" = [ | ||
json.newObject([ | ||
"image" = "ghcr.io/thegridman/test:1.0.0", | ||
"imageID" = "", | ||
"lastState" = [], | ||
"name" = "coherence", | ||
"ready" = False, | ||
"restartCount" = 0, | ||
"started" = False, | ||
"state" = [ | ||
"waiting" = ["reason" = "PodInitializing"], | ||
], | ||
]), | ||
], | ||
]), | ||
]); | ||
} | ||
} |