gitea源码

repo_key.go 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // DeployKey a deploy key
  8. type DeployKey struct {
  9. // ID is the unique identifier for the deploy key
  10. ID int64 `json:"id"`
  11. // KeyID is the associated public key ID
  12. KeyID int64 `json:"key_id"`
  13. // Key contains the actual SSH key content
  14. Key string `json:"key"`
  15. // URL is the API URL for this deploy key
  16. URL string `json:"url"`
  17. // Title is the human-readable name for the key
  18. Title string `json:"title"`
  19. // Fingerprint is the key's fingerprint
  20. Fingerprint string `json:"fingerprint"`
  21. // swagger:strfmt date-time
  22. // Created is the time when the deploy key was added
  23. Created time.Time `json:"created_at"`
  24. // ReadOnly indicates if the key has read-only access
  25. ReadOnly bool `json:"read_only"`
  26. // Repository is the repository this deploy key belongs to
  27. Repository *Repository `json:"repository,omitempty"`
  28. }
  29. // CreateKeyOption options when creating a key
  30. type CreateKeyOption struct {
  31. // Title of the key to add
  32. //
  33. // required: true
  34. // unique: true
  35. Title string `json:"title" binding:"Required"`
  36. // An armored SSH key to add
  37. //
  38. // required: true
  39. // unique: true
  40. Key string `json:"key" binding:"Required"`
  41. // Describe if the key has only read access or read/write
  42. //
  43. // required: false
  44. ReadOnly bool `json:"read_only"`
  45. }