Skip to content

Commit

Permalink
Move RunMode out of libkb (#13410)
Browse files Browse the repository at this point in the history
This is so that kbfs can remove a dependency on libkb.

Leave aliases to not break existing code.

Also move out KBFSLogFileName.
  • Loading branch information
akalin-keybase authored Aug 28, 2018
1 parent f3816d3 commit 93bf060
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
24 changes: 24 additions & 0 deletions go/kbconst/constants.go
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 11 additions & 9 deletions go/libkb/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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,
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 93bf060

Please sign in to comment.