...

Source file src/golang.conradwood.net/go-easyops/http/cookies.go

Documentation: golang.conradwood.net/go-easyops/http

     1  package http
     2  
     3  import (
     4  	"fmt"
     5  	"net/http"
     6  	"net/url"
     7  )
     8  
     9  type Cookies struct {
    10  	cookies []*http.Cookie
    11  }
    12  
    13  func (c *Cookies) SetCookies(u *url.URL, cookies []*http.Cookie) {
    14  	c.cookies = append(c.cookies, cookies...)
    15  }
    16  func (c *Cookies) Cookies(u *url.URL) []*http.Cookie {
    17  	return c.cookies
    18  }
    19  func (c *Cookies) Print() {
    20  	for _, ck := range c.cookies {
    21  		if *debug {
    22  			fmt.Printf("Cookie: %s\n", ck.Name)
    23  		}
    24  	}
    25  }
    26  

View as plain text