From 5043c16726e9e4a27c9de1926ba7c2d1be3f4f25 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Tue, 6 Aug 2024 15:49:22 -0700 Subject: [PATCH] /api/v1/streaming/public/local --- api/v1/streaming/public/local/client.go | 7 +++++++ api/v1/streaming/public/local/dial.go | 22 ++++++++++++++++++++++ api/v1/streaming/public/local/event.go | 7 +++++++ api/v1/streaming/public/local/path.go | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 api/v1/streaming/public/local/client.go create mode 100644 api/v1/streaming/public/local/dial.go create mode 100644 api/v1/streaming/public/local/event.go create mode 100644 api/v1/streaming/public/local/path.go diff --git a/api/v1/streaming/public/local/client.go b/api/v1/streaming/public/local/client.go new file mode 100644 index 0000000..18659c3 --- /dev/null +++ b/api/v1/streaming/public/local/client.go @@ -0,0 +1,7 @@ +package local + +import ( + "github.com/reiver/go-httpsse" +) + +type Client = httpsse.Client diff --git a/api/v1/streaming/public/local/dial.go b/api/v1/streaming/public/local/dial.go new file mode 100644 index 0000000..c7eddc0 --- /dev/null +++ b/api/v1/streaming/public/local/dial.go @@ -0,0 +1,22 @@ +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, + } + + return httpsse.DialURL(urloc.String()) +} + +func Dial(req *http.Request) (Client, error) { + return httpsse.Dial(req) +} diff --git a/api/v1/streaming/public/local/event.go b/api/v1/streaming/public/local/event.go new file mode 100644 index 0000000..d93fd3e --- /dev/null +++ b/api/v1/streaming/public/local/event.go @@ -0,0 +1,7 @@ +package local + +import ( + "github.com/reiver/go-httpsse" +) + +type Event = httpsse.Event diff --git a/api/v1/streaming/public/local/path.go b/api/v1/streaming/public/local/path.go new file mode 100644 index 0000000..0fd48f0 --- /dev/null +++ b/api/v1/streaming/public/local/path.go @@ -0,0 +1,3 @@ +package local + +const Path string = "/api/v1/streaming/public/local"