about summary refs log tree commit diff
path: root/structs.go
diff options
context:
space:
mode:
authorhanemile <mail@emile.space>2020-07-02 21:19:53 +0200
committerhanemile <mail@emile.space>2020-07-02 21:19:53 +0200
commit9095838d3c02c864c7a9642f492aa8387b58744e (patch)
tree7274bb76ad7ef3d3a7bd981dc251ed11485a0532 /structs.go
parent4828eb16f3f4cfc24e38fb3e2b26b0596ca0b255 (diff)
Initial commit
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go52
1 files changed, 52 insertions, 0 deletions
diff --git a/structs.go b/structs.go
new file mode 100644
index 0000000..fe417fd
--- /dev/null
+++ b/structs.go
@@ -0,0 +1,52 @@
+package main
+
+// Challenges describes the challenges as returned from the /acpi/v1/challenges
+// endpoint
+type Challenges struct {
+	Success bool `json:"success"`
+	Data    []struct {
+		ID       int           `json:"id"`
+		Type     string        `json:"type"`
+		Name     string        `json:"name"`
+		Value    int           `json:"value"`
+		Category string        `json:"category"`
+		Tags     []interface{} `json:"tags"`
+		Template string        `json:"template"`
+		Script   string        `json:"script"`
+	} `json:"data"`
+}
+
+// Challenge describes a single challenge as returned from the
+// /acpi/v1/challenges/<id> endpoint
+type Challenge struct {
+	Success bool `json:"success"`
+	Data    struct {
+		ID          int    `json:"id"`
+		Name        string `json:"name"`
+		Value       int    `json:"value"`
+		Description string `json:"description"`
+		Category    string `json:"category"`
+		State       string `json:"state"`
+		MaxAttempts int    `json:"max_attempts"`
+		Type        string `json:"type"`
+		TypeData    struct {
+			ID        string `json:"id"`
+			Name      string `json:"name"`
+			Templates struct {
+				Create string `json:"create"`
+				Update string `json:"update"`
+				View   string `json:"view"`
+			} `json:"templates"`
+			Scripts struct {
+				Create string `json:"create"`
+				Update string `json:"update"`
+				View   string `json:"view"`
+			} `json:"scripts"`
+		} `json:"type_data"`
+		Solves int           `json:"solves"`
+		Files  []string      `json:"files"`
+		Tags   []interface{} `json:"tags"`
+		Hints  []interface{} `json:"hints"`
+	} `json:"data"`
+}
+