Closed srlehn closed 4 years ago
I understand adding arbitrary filters, but how does this remove the need for telling it which browser you want to read from?
ah.... it doesn't. I had the separation from #14 in mind. then they are in firefox/chrome/... packages.
And i have something planned with a global search after locating the cookie dbs. I have some location code lying around which I have to prepare a bit. I was thinking a bit about the interface and structure but don't have much yet.
Here are some things I would like to add later:
type CookiesFile struct {
Browser, Profile, Path string
}
type Reader interface {
Read(*CookiesFile, ...Filter) ([]*Cookie, error)
}
type Searcher interface {
Search(browser, profile string) ([]*CookiesFile, error)
}
Ah, ok. Makes sense.
preparation for a signature change of the ReadCookie() funcs:
change of the Read...() functions remains.
https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis