-
Notifications
You must be signed in to change notification settings - Fork 8
/
events_token.go
45 lines (35 loc) · 1.01 KB
/
events_token.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
37
38
39
40
41
42
43
44
45
package scalingo
import "fmt"
type EventNewTokenTypeData struct {
TokenName string `json:"token_name"`
TokenID string `json:"token_id"`
}
type EventNewTokenType struct {
Event
TypeData EventNewTokenTypeData `json:"type_data"`
}
func (ev *EventNewTokenType) String() string {
return fmt.Sprintf("New token %v created", ev.TypeData.TokenName)
}
type EventRegenerateTokenTypeData struct {
TokenName string `json:"token_name"`
TokenID string `json:"token_id"`
}
type EventRegenerateTokenType struct {
Event
TypeData EventRegenerateTokenTypeData `json:"type_data"`
}
func (ev *EventRegenerateTokenType) String() string {
return fmt.Sprintf("Token %v regenerated", ev.TypeData.TokenName)
}
type EventDeleteTokenTypeData struct {
TokenName string `json:"token_name"`
TokenID string `json:"token_id"`
}
type EventDeleteTokenType struct {
Event
TypeData EventDeleteTokenTypeData `json:"type_data"`
}
func (ev *EventDeleteTokenType) String() string {
return fmt.Sprintf("Token %v deleted", ev.TypeData.TokenName)
}