summaryrefslogtreecommitdiff
path: root/internal/source/source.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2022-02-04 21:37:29 +0000
committerPaul Buetow <pbuetow@mimecast.com>2022-02-04 21:37:29 +0000
commit1db3b5dc1219e34e0e1c612e6646327701c40274 (patch)
treecab22128af9e54131facd0062a474459383a1c90 /internal/source/source.go
parent6625d019271d3d7931587167845d77834d187d57 (diff)
parentcc6f19f69d0fb34af96e17147b2030c352d46845 (diff)
merge 4.0.0-RC
Diffstat (limited to 'internal/source/source.go')
-rw-r--r--internal/source/source.go30
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")
+}