summaryrefslogtreecommitdiff
path: root/internal/source/source.go
blob: 4bb0784fb23f22ab79df45ab36b96c7b34ac2d0b (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
package source

// Source specifies the origin of either the current process (dtail is a client
// process, dserver is a server process) or the source code package (e.g.
// dserver server side code or dtail client side code). Notice that dtail client
// may also executes server code directly (e.g. via serverless mode) and that
// the dserver may also executes client code (e.g. via scheduled server side
// mapreduce queries).
type Source int

const (
	// Client process or source code package.
	Client Source = iota
	// Server process or source code package.
	Server Source = iota
	// HealthCheck process or client source code package.
	HealthCheck Source = iota
)

func (s Source) String() string {
	switch s {
	case Client:
		return "CLIENT"
	case Server:
		return "SERVER"
	case HealthCheck:
		return "HEALTHCHECK"
	}
	panic("Unknown source type")
}