-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move configuration params to a central place (#818)
- Loading branch information
1 parent
9cb34e5
commit 90c1b0c
Showing
14 changed files
with
145 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package peerdbenv | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// This file contains functions to get the values of various peerdb environment | ||
// variables. This will help catalog the environment variables that are used | ||
// throughout the codebase. | ||
|
||
// PEERDB_VERSION_SHA_SHORT | ||
func GetPeerDBVersionShaShort() string { | ||
return getEnvString("PEERDB_VERSION_SHA_SHORT", "unknown") | ||
} | ||
|
||
// PEERDB_DEPLOYMENT_UID | ||
func GetPeerDBDeploymentUID() string { | ||
return getEnvString("PEERDB_DEPLOYMENT_UID", "") | ||
} | ||
|
||
// PEERDB_CDC_CHANNEL_BUFFER_SIZE | ||
func GetPeerDBCDCChannelBufferSize() int { | ||
return getEnvInt("PEERDB_CDC_CHANNEL_BUFFER_SIZE", 1<<18) | ||
} | ||
|
||
// PEERDB_EVENTHUB_FLUSH_TIMEOUT_SECONDS | ||
func GetPeerDBEventhubFlushTimeoutSeconds() time.Duration { | ||
x := getEnvInt("PEERDB_EVENTHUB_FLUSH_TIMEOUT_SECONDS", 10) | ||
return time.Duration(x) * time.Second | ||
} | ||
|
||
// PEERDB_CDC_IDLE_TIMEOUT_SECONDS | ||
func GetPeerDBCDCIdleTimeoutSeconds() time.Duration { | ||
x := getEnvInt("PEERDB_CDC_IDLE_TIMEOUT_SECONDS", 60) | ||
return time.Duration(x) * time.Second | ||
} | ||
|
||
// PEERDB_CDC_DISK_SPILL_THRESHOLD | ||
func GetPeerDBCDCDiskSpillThreshold() int { | ||
return getEnvInt("PEERDB_CDC_DISK_SPILL_THRESHOLD", 1_000_000) | ||
} | ||
|
||
// PEERDB_CATALOG_HOST | ||
func GetPeerDBCatalogHost() string { | ||
return getEnvString("PEERDB_CATALOG_HOST", "") | ||
} | ||
|
||
// PEERDB_CATALOG_PORT | ||
func GetPeerDBCatalogPort() uint32 { | ||
return getEnvUint32("PEERDB_CATALOG_PORT", 5432) | ||
} | ||
|
||
// PEERDB_CATALOG_USER | ||
func GetPeerDBCatalogUser() string { | ||
return getEnvString("PEERDB_CATALOG_USER", "") | ||
} | ||
|
||
// PEERDB_CATALOG_PASSWORD | ||
func GetPeerDBCatalogPassword() string { | ||
return getEnvString("PEERDB_CATALOG_PASSWORD", "") | ||
} | ||
|
||
// PEERDB_CATALOG_DATABASE | ||
func GetPeerDBCatalogDatabase() string { | ||
return getEnvString("PEERDB_CATALOG_DATABASE", "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.