github.com/safing/portbase@v0.19.5/database/record/key.go (about)

     1  package record
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  // ParseKey splits a key into it's database name and key parts.
     8  func ParseKey(key string) (dbName, dbKey string) {
     9  	splitted := strings.SplitN(key, ":", 2)
    10  	if len(splitted) < 2 {
    11  		return splitted[0], ""
    12  	}
    13  	return splitted[0], strings.Join(splitted[1:], ":")
    14  }