]> Sergey Matveev's repositories - mmc.git/blobdiff - internal/var.go
internal package
[mmc.git] / internal / var.go
diff --git a/internal/var.go b/internal/var.go
new file mode 100644 (file)
index 0000000..ece260c
--- /dev/null
@@ -0,0 +1,47 @@
+// mmc -- Mattermost client
+// Copyright (C) 2023-2024 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package mmc
+
+import (
+       "os"
+       "time"
+)
+
+const (
+       PerPage    = 100
+       OutRec     = "out.rec"
+       OutRecLock = "out.rec.lock"
+       Last       = "last"
+)
+
+var SleepTime = 250 * time.Millisecond
+
+func GetEntrypoint() string {
+       s := os.Getenv("MMC_ENTRYPOINT")
+       if s == "" {
+               return "http://mm.invalid"
+       }
+       return s
+}
+
+func GetSPKIHash() string {
+       s := os.Getenv("MMC_SPKI")
+       if s == "" {
+               return "deadbeef"
+       }
+       return s
+}