2024-12-07 03:53:46 -05:00
|
|
|
package extractor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Cookie struct {
|
|
|
|
Name string
|
|
|
|
Value string
|
|
|
|
Domain string
|
|
|
|
Path string
|
|
|
|
Expires time.Time
|
|
|
|
Secure bool
|
|
|
|
HttpOnly bool
|
|
|
|
}
|
|
|
|
type CookieJar interface {
|
|
|
|
GetAll() ([]Cookie, error)
|
|
|
|
Set(cookie Cookie) error
|
|
|
|
Delete(cookie Cookie) error
|
|
|
|
}
|
2024-12-17 23:16:13 -05:00
|
|
|
|
|
|
|
// ReadOnlyCookieJar is a wrapper for CookieJar that allows only read operations on cookies, but all
|
|
|
|
// write operations are no-ops.
|
|
|
|
type ReadOnlyCookieJar struct {
|
|
|
|
Jar CookieJar
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyCookieJar) GetAll() ([]Cookie, error) {
|
|
|
|
return r.Jar.GetAll()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyCookieJar) Set(_ Cookie) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ReadOnlyCookieJar) Delete(_ Cookie) error {
|
|
|
|
return nil
|
|
|
|
}
|