forked from kata-containers/tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
55 lines (43 loc) · 915 Bytes
/
types.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
46
47
48
49
50
51
52
53
54
55
// Copyright (c) 2019 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package main
type Category struct {
Name string
Description string
URL string `yaml:",omitempty"`
}
type Label struct {
Name string
Description string
CategoryName string `yaml:"category"`
Colour string `yaml:"color"`
From string `yaml:",omitempty"`
}
type Categories []Category
func (c Categories) Len() int {
return len(c)
}
func (c Categories) Swap(i, j int) {
c[i], c[j] = c[j], c[i]
}
func (c Categories) Less(i, j int) bool {
return c[i].Name < c[j].Name
}
type Labels []Label
func (l Labels) Len() int {
return len(l)
}
func (l Labels) Swap(i, j int) {
l[i], l[j] = l[j], l[i]
}
func (l Labels) Less(i, j int) bool {
return l[i].Name < l[j].Name
}
type LabelsFile struct {
Description string
Categories Categories
Repo string
Labels Labels
}