diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-05-11 18:21:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-11 18:21:34 +0800 |
commit | 34eee25bd42d19287e3e33afd169cc979ab61f37 (patch) | |
tree | 8def3b2f224745e3fbc0adaec2f01d7f752c443d /modules/structs/user_gpgkey.go | |
parent | 1658cd04e9918109867f2745ddf760d260681878 (diff) | |
download | gitea-34eee25bd42d19287e3e33afd169cc979ab61f37.tar.gz gitea-34eee25bd42d19287e3e33afd169cc979ab61f37.zip |
Move sdk structs to modules/structs (#6905)
* move sdk structs to moduels/structs
* fix tests
* fix fmt
* fix swagger
* fix vendor
Diffstat (limited to 'modules/structs/user_gpgkey.go')
-rw-r--r-- | modules/structs/user_gpgkey.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/structs/user_gpgkey.go b/modules/structs/user_gpgkey.go new file mode 100644 index 0000000000..f501a09cb9 --- /dev/null +++ b/modules/structs/user_gpgkey.go @@ -0,0 +1,43 @@ +// Copyright 2017 Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package structs + +import ( + "time" +) + +// GPGKey a user GPG key to sign commit and tag in repository +type GPGKey struct { + ID int64 `json:"id"` + PrimaryKeyID string `json:"primary_key_id"` + KeyID string `json:"key_id"` + PublicKey string `json:"public_key"` + Emails []*GPGKeyEmail `json:"emails"` + SubsKey []*GPGKey `json:"subkeys"` + CanSign bool `json:"can_sign"` + CanEncryptComms bool `json:"can_encrypt_comms"` + CanEncryptStorage bool `json:"can_encrypt_storage"` + CanCertify bool `json:"can_certify"` + // swagger:strfmt date-time + Created time.Time `json:"created_at,omitempty"` + // swagger:strfmt date-time + Expires time.Time `json:"expires_at,omitempty"` +} + +// GPGKeyEmail an email attached to a GPGKey +// swagger:model GPGKeyEmail +type GPGKeyEmail struct { + Email string `json:"email"` + Verified bool `json:"verified"` +} + +// CreateGPGKeyOption options create user GPG key +type CreateGPGKeyOption struct { + // An armored GPG key to add + // + // required: true + // unique: true + ArmoredKey string `json:"armored_public_key" binding:"Required"` +} |