From 8628dc77b93641b525c586b8a17fb1f75df3439a Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Thu, 15 Feb 2024 09:47:09 -0800 Subject: [PATCH] initial commits --- framewriter_internal.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/framewriter_internal.go b/framewriter_internal.go index a95732a..3a9602d 100644 --- a/framewriter_internal.go +++ b/framewriter_internal.go @@ -10,6 +10,24 @@ type internalFrameWriter struct { var _ FrameWriter = internalFrameWriter{} +// CreateFrameWriter returns a FrameWriter that writers to an io.Writer. +// +// For example: +// +// func ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { +// +// // ... +// +// var frameWriter frameproto.FrameWriter = frameproto.CreateFrameWriter(responseWriter) +// +// // ... +// +// frameWriter.WriteFrame(frameproto.VersionVNext) +// frameWriter.WriteFrameImage(imageURL) +// +// // ... +// +// } func CreateFrameWriter(writer io.Writer) FrameWriter { return internalFrameWriter{ writer:writer,