mirror of
https://github.com/safing/portbase
synced 2025-09-01 10:09:50 +00:00
14 lines
282 B
Go
14 lines
282 B
Go
package model
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// ParseKey splits a key into it's database name and key parts.
|
|
func ParseKey(key string) (dbName, dbKey string) {
|
|
splitted := strings.SplitN(key, ":", 2)
|
|
if len(splitted) == 2 {
|
|
return splitted[0], splitted[1]
|
|
}
|
|
return splitted[0], ""
|
|
}
|