api_key.go 741 B

1234567891011121314151617181920212223242526
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package model // import "miniflux.app/v2/internal/model"
  4. import (
  5. "time"
  6. )
  7. // APIKey represents an application API key.
  8. type APIKey struct {
  9. ID int64 `json:"id"`
  10. UserID int64 `json:"user_id"`
  11. Token string `json:"token"`
  12. Description string `json:"description"`
  13. LastUsedAt *time.Time `json:"last_used_at"`
  14. CreatedAt time.Time `json:"created_at"`
  15. }
  16. // APIKeys represents a collection of API Key.
  17. type APIKeys []*APIKey
  18. // APIKeyCreationRequest represents the request to create a new API Key.
  19. type APIKeyCreationRequest struct {
  20. Description string `json:"description"`
  21. }