cookie

package
v3.3.6 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cookie allows for the modification of cookies on http requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilter

func NewFilter(cookie *http.Cookie) *filter.Filter

NewFilter builds a new cookie filter.

func NewModifier

func NewModifier(cookie *http.Cookie) martian.RequestResponseModifier

NewModifier returns a modifier that injects the provided cookie into the request or response.

Types

type Matcher

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

Matcher is a conditonal evalutor of request or response cookies to be used in structs that take conditions.

func NewMatcher

func NewMatcher(cookie *http.Cookie) *Matcher

NewMatcher builds a cookie matcher.

func (*Matcher) MatchRequest

func (m *Matcher) MatchRequest(req *http.Request) bool

MatchRequest evaluates a request and returns whether or not the request contains a cookie that matches the provided name, path and value.

func (*Matcher) MatchResponse

func (m *Matcher) MatchResponse(res *http.Response) bool

MatchResponse evaluates a response and returns whether or not the response contains a cookie that matches the provided name and value.

Jump to

Keyboard shortcuts

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