mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
14 lines
283 B
Go
14 lines
283 B
Go
package record
|
|
|
|
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], ""
|
|
}
|