File: types.go

package info (click to toggle)
golang-github-mimuret-golang-iij-dpf 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: makefile: 55
file content (47 lines) | stat: -rw-r--r-- 767 bytes parent folder | download
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
package types

type Boolean int

const (
	Enabled  Boolean = 1
	Disabled Boolean = 0
)

func (c Boolean) String() string {
	booleanToString := map[Boolean]string{
		Enabled:  "Enabled",
		Disabled: "Disabled",
	}
	return booleanToString[c]
}

type State int

const (
	StateBeforeStart State = 1
	StateRunning     State = 2
)

func (c State) String() string {
	stateToString := map[State]string{
		StateBeforeStart: "BeforeStart",
		StateRunning:     "Started",
	}

	return stateToString[c]
}

type Favorite int

const (
	FavoriteHighPriority Favorite = 1
	FavoriteLowPriority  Favorite = 2
)

func (c Favorite) String() string {
	favoriteToString := map[Favorite]string{
		FavoriteHighPriority: "High",
		FavoriteLowPriority:  "Low",
	}
	return favoriteToString[c]
}