Documentation
¶
Index ¶
Constants ¶
View Source
const (
ErrNotField = erorr.Error("httpsse: not field")
)
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(namewriter io.Writer, valuewriter io.Writer, runescanner io.RuneScanner) (namewritten int64, valuewritten int64, err error)
Copy copies the 'field' as defined by the HTTP-SSE specification: https://html.spec.whatwg.org/multipage/server-sent-events.html
field = 1*name-char [ colon [ space ] *any-char ] end-of-line
func WriteString ¶
WriteString writes a 'field' as defined by the HTTP-SSE specification: https://html.spec.whatwg.org/multipage/server-sent-events.html
For example, this:
comment.WriteString(writer, "message", "Hello world!")
Would write this:
"message: Hello world!\n"
Also, for example, this:
comment.WriteString(writer, "do-it", "once\ntwice\nthrice\nfource")
Would write this:
"do-it: once\ndo-it: twice\ndo-it: thrice\ndo-it: fource\n"
I.e., this:
"do-it: once" +"\n"+ "do-it: twice" +"\n"+ "do-it: thrice" +"\n"+ "do-it: fource" +"\n"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.