mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +00:00
chore: update common utils
This commit is contained in:
parent
d97cbbb183
commit
6a5defe9d6
@ -5,21 +5,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus {
|
func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus {
|
||||||
switch status {
|
if status == "NORMAL" {
|
||||||
case "NORMAL":
|
|
||||||
return storepb.RowStatus_NORMAL
|
return storepb.RowStatus_NORMAL
|
||||||
case "ARCHIVED":
|
|
||||||
return storepb.RowStatus_ARCHIVED
|
|
||||||
}
|
}
|
||||||
return storepb.RowStatus_ROW_STATUS_UNSPECIFIED
|
// Otherwise, fallback to archived status.
|
||||||
|
return storepb.RowStatus_ARCHIVED
|
||||||
}
|
}
|
||||||
|
|
||||||
func ConvertVisibilityStringToStorepb(visibility string) storepb.Visibility {
|
func ConvertVisibilityStringToStorepb(visibility string) storepb.Visibility {
|
||||||
switch visibility {
|
if visibility == "PUBLIC" {
|
||||||
case "PRIVATE", "WORKSPACE":
|
|
||||||
return storepb.Visibility_WORKSPACE
|
|
||||||
case "PUBLIC":
|
|
||||||
return storepb.Visibility_PUBLIC
|
return storepb.Visibility_PUBLIC
|
||||||
}
|
}
|
||||||
return storepb.Visibility_VISIBILITY_UNSPECIFIED
|
// Otherwise, fallback to workspace visibility.
|
||||||
|
return storepb.Visibility_WORKSPACE
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user