diff --git a/go/kbconst/constants.go b/go/kbconst/constants.go new file mode 100644 index 000000000000..7fdde52b5db1 --- /dev/null +++ b/go/kbconst/constants.go @@ -0,0 +1,24 @@ +// Copyright 2018 Keybase, Inc. All rights reserved. Use of +// this source code is governed by the included BSD license. + +package kbconst + +// RunMode is an enum type for the mode the Keybase app runs in. +type RunMode string + +const ( + // DevelRunMode means use devel servers. + DevelRunMode RunMode = "devel" + // StagingRunMode means use staging servers. + StagingRunMode RunMode = "staging" + // ProductionRunMode means use prod servers (default for + // released apps). + ProductionRunMode RunMode = "prod" + // RunModeError means an error was encountered. + RunModeError RunMode = "error" + // NoRunMode is the nil value for RunMode. + NoRunMode RunMode = "" +) + +// KBFSLogFileName is the name of the log file for KBFS. +const KBFSLogFileName = "keybase.kbfs.log" diff --git a/go/libkb/constants.go b/go/libkb/constants.go index 92520123d6b8..126d77a3f4af 100644 --- a/go/libkb/constants.go +++ b/go/libkb/constants.go @@ -8,6 +8,7 @@ import ( "runtime" "time" + "github.com/keybase/client/go/kbconst" keybase1 "github.com/keybase/client/go/protocol/keybase1" "github.com/keybase/saltpack" ) @@ -21,18 +22,19 @@ const ( var TorProxy = "localhost:9050" -type RunMode string +// TODO (CORE-6576): Remove these aliases once everything outside of +// this repo points to kbconst.RunMode. + +type RunMode = kbconst.RunMode const ( - DevelRunMode RunMode = "devel" - StagingRunMode RunMode = "staging" - ProductionRunMode RunMode = "prod" - RunModeError RunMode = "error" - NoRunMode RunMode = "" + DevelRunMode RunMode = kbconst.DevelRunMode + StagingRunMode RunMode = kbconst.StagingRunMode + ProductionRunMode RunMode = kbconst.ProductionRunMode + RunModeError RunMode = kbconst.RunModeError + NoRunMode RunMode = kbconst.NoRunMode ) -var RunModes = []RunMode{DevelRunMode, StagingRunMode, ProductionRunMode} - var ServerLookup = map[RunMode]string{ DevelRunMode: DevelServerURI, StagingRunMode: StagingServerURI, @@ -567,7 +569,7 @@ const ( const ( ServiceLogFileName = "keybase.service.log" - KBFSLogFileName = "keybase.kbfs.log" + KBFSLogFileName = kbconst.KBFSLogFileName GitLogFileName = "keybase.git.log" UpdaterLogFileName = "keybase.updater.log" DesktopLogFileName = "Keybase.app.log"