Open hmert opened 3 years ago
Hi @hmert. I have an idea for implementing proxy commands to more clear. I wanted to get approval from you. proxy.go file is starting to be more complicated and messy for future commands. I was writing code for --proxy-digest
flag and I had to modify proxyUserCmd
by adding a new parameter. But, adding a new parameter affects to proxy_test.go
file and proxyUserCredentials, err := proxyUserCmd(proxyUser)
line. I think this problem will grow and be a problem. Maybe, refactoring will be necessary for each flag. That's why I think we can define a struct as follows:
type GurlProxy struct {
proxyURL string
proxyUser string
username string
password string
basic bool
digest bool
ntlm bool
negotiate bool
}
This struct may grow in the future, but I think, in this way, we suffer less pain. I am going to store necessary information as a struct and I'll convert functions to methods like func (g *GurlProxy) proxyCmd() (string, error)
. What do you think about that?