-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct.go
36 lines (28 loc) · 965 Bytes
/
struct.go
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
package main
import "encoding/json"
// Config Base structure of a json config file.
type Config struct {
Destinations []*Destination `json:"destinations"`
WebAddress string `json:"web_address"`
EnableStatistics bool `json:"enable_statistics"`
EnablePPRof bool `json:"enable_pprof"`
}
// Destination Defines a single webhook destination's configuration.
type Destination struct {
Name string `json:"name"`
Description string `json:"description"`
Webhook string `json:"webhook"`
Username *string `json:"username"`
Avatar *string `json:"avatar"`
Cron string `json:"cron"`
Sources []*Source `json:"sources"`
}
//Source Defines a single source's configuration.
type Source struct {
Name string `json:"name"`
Description string `json:"description"`
Service string `json:"service"`
Chance int `json:"chance"`
Display string `json:"display"`
OptionalArguments json.RawMessage `json:"arguments"`
}