gitea源码

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // PublicKey publickey is a user key to push code to repository
  8. type PublicKey struct {
  9. // ID is the unique identifier for the public key
  10. ID int64 `json:"id"`
  11. // Key contains the actual SSH public key content
  12. Key string `json:"key"`
  13. // URL is the API URL for this key
  14. URL string `json:"url,omitempty"`
  15. // Title is the human-readable name for the key
  16. Title string `json:"title,omitempty"`
  17. // Fingerprint is the key's fingerprint
  18. Fingerprint string `json:"fingerprint,omitempty"`
  19. // swagger:strfmt date-time
  20. // Created is the time when the key was added
  21. Created time.Time `json:"created_at"`
  22. // Updated is the time when the key was last used
  23. Updated time.Time `json:"last_used_at"`
  24. // Owner is the user who owns this key
  25. Owner *User `json:"user,omitempty"`
  26. // ReadOnly indicates if the key has read-only access
  27. ReadOnly bool `json:"read_only,omitempty"`
  28. // KeyType indicates the type of the SSH key
  29. KeyType string `json:"key_type,omitempty"`
  30. }