api_key.go 486 B

123456789101112131415161718192021
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package form // import "miniflux.app/v2/internal/ui/form"
  4. import (
  5. "net/http"
  6. "strings"
  7. )
  8. // APIKeyForm represents the API Key form.
  9. type APIKeyForm struct {
  10. Description string
  11. }
  12. // NewAPIKeyForm returns a new APIKeyForm.
  13. func NewAPIKeyForm(r *http.Request) *APIKeyForm {
  14. return &APIKeyForm{
  15. Description: strings.TrimSpace(r.FormValue("description")),
  16. }
  17. }