forked from google/trillian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sensible default quota and storage systems when MySQL support unavail…
…able (google#3679) * Choose sensible default quota and storage systems when MySQL support unavailable * Update CHANGELOG.md
- Loading branch information
1 parent
92bc601
commit 5209ff1
Showing
4 changed files
with
37 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package provider | ||
|
||
import ( | ||
"slices" | ||
|
||
"github.com/google/trillian/quota" | ||
"github.com/google/trillian/storage" | ||
) | ||
|
||
var ( | ||
DefaultQuotaSystem string | ||
DefaultStorageSystem string | ||
) | ||
|
||
func init() { | ||
defaultProvider := "mysql" | ||
providers := storage.Providers() | ||
if len(providers) > 0 && !slices.Contains(providers, defaultProvider) { | ||
slices.Sort(providers) | ||
defaultProvider = providers[0] | ||
} | ||
DefaultStorageSystem = defaultProvider | ||
|
||
providers = quota.Providers() | ||
if len(providers) > 0 && !slices.Contains(providers, defaultProvider) { | ||
slices.Sort(providers) | ||
defaultProvider = providers[0] | ||
} | ||
DefaultQuotaSystem = defaultProvider | ||
} |
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