cookie

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Cookies Package helps reading and setting the cookie The cookie struct's instance is availaible to both goexpress.Request and goexpress.Response

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	// contains filtered or unexported fields
}

Cookie struct

func (*Cookie) Add

func (c *Cookie) Add(cookie *http.Cookie) *Cookie

Adds a cookie

func (*Cookie) Del

func (c *Cookie) Del(name string) *Cookie

Deletes a cookie

func (*Cookie) Finish

func (c *Cookie) Finish()

An internal function to set all the cookies before pushing response body

func (*Cookie) Get

func (c *Cookie) Get(name string) string

Returns a cookie

func (*Cookie) GetAll added in v1.0.1

func (c *Cookie) GetAll() map[string]*http.Cookie

Returns the map of all the cookies

func (*Cookie) Init

func (c *Cookie) Init(response Response, request *http.Request) *Cookie

Initialise the Cookie struct with goexpress.Response and http request

func (*Cookie) InitReadOnly

func (c *Cookie) InitReadOnly(request *http.Request) *Cookie

Initialise a Cookie struct for use of Request Struct

type Response

type Response interface {
	AddCookie(str string, value string)
}

An interface to set the cookie in response

Jump to

Keyboard shortcuts

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