about summary refs log tree commit diff
path: root/structs.go
blob: fe417fd51de1d14b1d28bd368019820019ae7a99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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"`
}