diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-19 12:51:34 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-19 12:51:34 +0200 |
commit | 48c0f89ee7a350b601a62a524fca875afe5138bb (patch) | |
tree | 42a839d590922647a372c9db80e383eb8cbfc683 /cookie.go | |
parent | Added SetUint helper to Args (diff) | |
download | fasthttp-48c0f89ee7a350b601a62a524fca875afe5138bb.tar.gz fasthttp-48c0f89ee7a350b601a62a524fca875afe5138bb.tar.bz2 fasthttp-48c0f89ee7a350b601a62a524fca875afe5138bb.zip |
Added Stringer implementations to URI, Args and Cookie
Diffstat (limited to 'cookie.go')
-rw-r--r-- | cookie.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -75,6 +75,19 @@ func (c *Cookie) AppendBytes(dst []byte) []byte { return dst } +// Cookie returns cookie representation. +// +// The returned value is valid until the next call to Cookie methods. +func (c *Cookie) Cookie() []byte { + c.buf = c.AppendBytes(c.buf[:0]) + return c.buf +} + +// String returns cookie representation. +func (c *Cookie) String() string { + return string(c.Cookie()) +} + var errNoCookies = errors.New("no cookies found") // Parse parses Set-Cookie header. |