Moved code to top-level.

This commit is contained in:
Jay
2026-01-26 10:28:39 -05:00
parent 17fb1c6c9a
commit 5ee9ef500e
16 changed files with 95 additions and 90 deletions

20
url.go Normal file
View File

@@ -0,0 +1,20 @@
package honeybee
import (
"net/url"
"git.wisehodl.dev/jay/go-honeybee/errors"
)
func ParseURL(urlStr string) (*url.URL, error) {
parsedURL, err := url.Parse(urlStr)
if err != nil {
return nil, err
}
if parsedURL.Scheme != "ws" && parsedURL.Scheme != "wss" {
return nil, errors.InvalidProtocol
}
return parsedURL, nil
}