cookieutil

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cookieutil implements functions for working with http cookie.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCookie

func DeleteCookie(rw http.ResponseWriter, req *http.Request, key string) error

DeleteCookie deletes cookie for specified key. Cookie key should be presented as string. Returns error if cookie not found.

func GetCookieValue

func GetCookieValue(req *http.Request, key string) (string, error)

GetCookieValue returns cookie value for specified key. Cookie value is presented as string. Returns error if cookie not found.

func SaveCookie

func SaveCookie(rw http.ResponseWriter, key string, value string)

SaveCookie saves cookie with specified key and value. Key and value should presented as strings.

func SetExpiration

func SetExpiration(duration string) error

SetExpiration sets cookie duration expiration for SaveCookie func. If time.ParseDuration occurs any error, this will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL