diff options
author | 2018-01-02 22:04:48 -0800 | |
---|---|---|
committer | 2018-01-02 22:04:48 -0800 | |
commit | 320d1b016747ba4501da9417d9ce5f99368a5768 (patch) | |
tree | 1054d96afde6022951b76cc4a09b78e1e3f05058 /server/ui/form/integration.go | |
parent | c39f2e1a8d2de6d412bcc673d29eb0f7a2d1f5f7 (diff) | |
download | v2-320d1b016747ba4501da9417d9ce5f99368a5768.tar.gz v2-320d1b016747ba4501da9417d9ce5f99368a5768.tar.zst v2-320d1b016747ba4501da9417d9ce5f99368a5768.zip |
Refactor packages to have more idiomatic code base
Diffstat (limited to 'server/ui/form/integration.go')
-rw-r--r-- | server/ui/form/integration.go | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/server/ui/form/integration.go b/server/ui/form/integration.go deleted file mode 100644 index 8cc6d356..00000000 --- a/server/ui/form/integration.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2017 Frédéric Guillot. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package form - -import ( - "net/http" - - "github.com/miniflux/miniflux/model" -) - -// IntegrationForm represents user integration settings form. -type IntegrationForm struct { - PinboardEnabled bool - PinboardToken string - PinboardTags string - PinboardMarkAsUnread bool - InstapaperEnabled bool - InstapaperUsername string - InstapaperPassword string - FeverEnabled bool - FeverUsername string - FeverPassword string - WallabagEnabled bool - WallabagURL string - WallabagClientID string - WallabagClientSecret string - WallabagUsername string - WallabagPassword string -} - -// Merge copy form values to the model. -func (i IntegrationForm) Merge(integration *model.Integration) { - integration.PinboardEnabled = i.PinboardEnabled - integration.PinboardToken = i.PinboardToken - integration.PinboardTags = i.PinboardTags - integration.PinboardMarkAsUnread = i.PinboardMarkAsUnread - integration.InstapaperEnabled = i.InstapaperEnabled - integration.InstapaperUsername = i.InstapaperUsername - integration.InstapaperPassword = i.InstapaperPassword - integration.FeverEnabled = i.FeverEnabled - integration.FeverUsername = i.FeverUsername - integration.FeverPassword = i.FeverPassword - integration.WallabagEnabled = i.WallabagEnabled - integration.WallabagURL = i.WallabagURL - integration.WallabagClientID = i.WallabagClientID - integration.WallabagClientSecret = i.WallabagClientSecret - integration.WallabagUsername = i.WallabagUsername - integration.WallabagPassword = i.WallabagPassword -} - -// NewIntegrationForm returns a new AuthForm. -func NewIntegrationForm(r *http.Request) *IntegrationForm { - return &IntegrationForm{ - PinboardEnabled: r.FormValue("pinboard_enabled") == "1", - PinboardToken: r.FormValue("pinboard_token"), - PinboardTags: r.FormValue("pinboard_tags"), - PinboardMarkAsUnread: r.FormValue("pinboard_mark_as_unread") == "1", - InstapaperEnabled: r.FormValue("instapaper_enabled") == "1", - InstapaperUsername: r.FormValue("instapaper_username"), - InstapaperPassword: r.FormValue("instapaper_password"), - FeverEnabled: r.FormValue("fever_enabled") == "1", - FeverUsername: r.FormValue("fever_username"), - FeverPassword: r.FormValue("fever_password"), - WallabagEnabled: r.FormValue("wallabag_enabled") == "1", - WallabagURL: r.FormValue("wallabag_url"), - WallabagClientID: r.FormValue("wallabag_client_id"), - WallabagClientSecret: r.FormValue("wallabag_client_secret"), - WallabagUsername: r.FormValue("wallabag_username"), - WallabagPassword: r.FormValue("wallabag_password"), - } -} |