diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-22 01:32:39 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-22 01:32:39 +0200 |
commit | 924d119e969814b79152f54af03046264c874185 (patch) | |
tree | 8c7ba6920876926a934cb9958d3988396130c8b0 /cookie.go | |
parent | API prettifying: ServeConnTime -> ConnTime, ServeConnRequestNum -> ConnReques... (diff) | |
download | fasthttp-924d119e969814b79152f54af03046264c874185.tar.gz fasthttp-924d119e969814b79152f54af03046264c874185.tar.bz2 fasthttp-924d119e969814b79152f54af03046264c874185.zip |
Added Cookie.WriteTo
Diffstat (limited to 'cookie.go')
-rw-r--r-- | cookie.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -3,6 +3,7 @@ package fasthttp import ( "bytes" "errors" + "io" "time" ) @@ -88,6 +89,14 @@ func (c *Cookie) String() string { return string(c.Cookie()) } +// WriteTo writes cookie representation to w. +// +// WriteTo implements io.WriterTo interface. +func (c *Cookie) WriteTo(w io.Writer) (int64, error) { + n, err := w.Write(c.Cookie()) + return int64(n), err +} + var errNoCookies = errors.New("no cookies found") // Parse parses Set-Cookie header. |