go-mstdn/api/v1/streaming/public/local/dial.go

37 lines
527 B
Go
Raw Normal View History

2024-08-06 22:49:22 +00:00
package local
import (
"net/http"
"net/url"
"github.com/reiver/go-httpsse"
)
func DialHost(host string) (Client, error) {
var urloc = url.URL{
Scheme:"https",
Host:host,
Path:Path,
}
2024-08-07 15:05:46 +00:00
sseclient, err := httpsse.DialURL(urloc.String())
if nil != err {
return nil, err
}
return &internalClient{
sseclient:sseclient,
}, nil
2024-08-06 22:49:22 +00:00
}
func Dial(req *http.Request) (Client, error) {
2024-08-07 15:05:46 +00:00
sseclient, err :=httpsse.Dial(req)
if nil != err {
return nil, err
}
return &internalClient{
sseclient:sseclient,
}, nil
2024-08-06 22:49:22 +00:00
}