You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
440 B

package model
import (
"fmt"
"net/url"
)
const (
// NoRoom default no room key
NoRoom = "noroom"
)
// EncodeRoomKey encode a room key.
func EncodeRoomKey(business string, room string) string {
return fmt.Sprintf("%s://%s", business, room)
}
// DecodeRoomKey decode room key.
func DecodeRoomKey(key string) (string, string, error) {
u, err := url.Parse(key)
if err != nil {
return "", "", err
}
return u.Scheme, u.Host, nil
}