diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-10-15 12:38:39 +0300 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-10-15 12:38:39 +0300 |
| commit | 1edc1469024d3cb74473bd99959d5d1068229c39 (patch) | |
| tree | 72618e384626d9fc368994e3f24be9e9892d0610 /internal/source | |
| parent | 4e1b7f6ff7e3f10bda852da90f7b62d5dbccd455 (diff) | |
| parent | c0332e8fa13f4939de17c856b2e71fd093847253 (diff) | |
merge from github.com/snonux/dtail
Diffstat (limited to 'internal/source')
| -rw-r--r-- | internal/source/source.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/source/source.go b/internal/source/source.go new file mode 100644 index 0000000..4bb0784 --- /dev/null +++ b/internal/source/source.go @@ -0,0 +1,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") +} |
