cookiemonster

package module
v0.0.0-...-1584578 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 8 Imported by: 30

README

CookieMonster

GoDoc Build Status

A simple package for parsing Netscape Cookie File formatted cookies into Go Cookies

Install

go get -u github.com/MercuryEngineering/CookieMonster

Example
import (
  "fmt"
  "github.com/MercuryEngineering/CookieMonster"
)

cookies, err := cookiemonster.ParseFile("cookies.txt")
if err != nil {
  panic(err)
}

for _, cookie := range cookies {
  fmt.Printf("%s=%s\n", cookie.Name, cookie.Value)
}

Documentation

Overview

Package cookiemonster provides methods for parsing Netscape format cookie files into slices of http.Cookie

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader) ([]*http.Cookie, error)

Parse will parse r and will return a slice of *http.Cookie or an error

func ParseFile

func ParseFile(path string) ([]*http.Cookie, error)

ParseFile parses the file located at path and will return a slice of *http.Cookie or an error

func ParseString

func ParseString(s string) ([]*http.Cookie, error)

ParseString parses s and will return a slice of *http.Cookie or an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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