From 9095838d3c02c864c7a9642f492aa8387b58744e Mon Sep 17 00:00:00 2001 From: hanemile Date: Thu, 2 Jul 2020 21:19:53 +0200 Subject: Initial commit --- structs.go | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 structs.go (limited to 'structs.go') 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/ 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"` +} + -- cgit 1.4.1