oauthutil: tidy interface to Config to add Options struct
The interface was getting so that a new function was needed for every Config variant. Adding an Options struct fixes this.
This commit is contained in:
parent
c08617c70f
commit
49ba4eeb86
14 changed files with 44 additions and 39 deletions
|
@ -60,7 +60,10 @@ func init() {
|
|||
Description: "Put.io",
|
||||
NewFs: NewFs,
|
||||
Config: func(name string, m configmap.Mapper) {
|
||||
err := oauthutil.ConfigNoOffline("putio", name, m, putioConfig)
|
||||
opt := oauthutil.Options{
|
||||
NoOffline: true,
|
||||
}
|
||||
err := oauthutil.Config("putio", name, m, putioConfig, &opt)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to configure token: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue