You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.0 KiB

  1. package types
  2. // CreateKeyRequest is sent to create a new key
  3. type CreateKeyRequest struct {
  4. Name string `json:"name" validate:"required,min=4,printascii"`
  5. Passphrase string `json:"passphrase" validate:"required,min=10"`
  6. Algo string `json:"algo"`
  7. }
  8. // DeleteKeyRequest to destroy a key permanently (careful!)
  9. type DeleteKeyRequest struct {
  10. Name string `json:"name" validate:"required,min=4,printascii"`
  11. Passphrase string `json:"passphrase" validate:"required,min=10"`
  12. }
  13. // UpdateKeyRequest is sent to update the passphrase for an existing key
  14. type UpdateKeyRequest struct {
  15. Name string `json:"name" validate:"required,min=4,printascii"`
  16. OldPass string `json:"passphrase" validate:"required,min=10"`
  17. NewPass string `json:"new_passphrase" validate:"required,min=10"`
  18. }
  19. // ErrorResponse is returned for 4xx and 5xx errors
  20. type ErrorResponse struct {
  21. Success bool `json:"success"`
  22. Error string `json:"error"` // error message if Success is false
  23. Code int `json:"code"` // error code if Success is false
  24. }