header

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	Name     string    `json:"name"`
	Value    string    `json:"value"`
	Path     string    `json:"path,omitempty"`
	Domain   string    `json:"domain,omitempty"`
	Expires  time.Time `json:"expires,omitempty"`
	MaxAge   int       `json:"maxAge,omitempty"`
	Secure   bool      `json:"secure,omitempty"`
	HTTPOnly bool      `json:"httpOnly,omitempty"`
	SameSite string    `json:"sameSite,omitempty"`
}

func NewCookie

func NewCookie(c *http.Cookie) *Cookie

func (*Cookie) Equals

func (c *Cookie) Equals(x *Cookie) bool

func (*Cookie) Matches

func (c *Cookie) Matches(x *Cookie) bool

func (*Cookie) Native

func (c *Cookie) Native() *http.Cookie

func (*Cookie) NativeSmall

func (c *Cookie) NativeSmall() *http.Cookie

func (*Cookie) String

func (c *Cookie) String() string

type Cookies

type Cookies []*Cookie

func ParseCookies

func ParseCookies(cs []*http.Cookie) Cookies

func (Cookies) Native

func (c Cookies) Native() []*http.Cookie

func (Cookies) Qualifying

func (c Cookies) Qualifying(url *url.URL) Cookies

func (Cookies) String

func (c Cookies) String() string
type Header struct {
	Key         string `json:"k,omitempty"`
	Value       string `json:"v,omitempty"`
	Description string `json:"desc,omitempty"`
}

func (Header) Merge

func (h Header) Merge(data npncore.Data, logger *logrus.Logger) *Header

type Headers

type Headers []*Header

func (Headers) Clone

func (h Headers) Clone() Headers

func (Headers) Contains

func (h Headers) Contains(k string) bool

func (Headers) Get

func (h Headers) Get(k string) *Header

func (Headers) GetValue

func (h Headers) GetValue(k string) string

func (Headers) Merge

func (h Headers) Merge(data npncore.Data, logger *logrus.Logger) Headers

func (Headers) Set

func (h Headers) Set(k string, v string) Headers

func (Headers) Sort

func (h Headers) Sort()

func (Headers) ToHTTP

func (h Headers) ToHTTP() http.Header

Jump to

Keyboard shortcuts

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