basesecret.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package kms
  2. // baseSecret defines the base struct shared among all the secret providers
  3. type baseSecret struct {
  4. Status SecretStatus `json:"status,omitempty"`
  5. Payload string `json:"payload,omitempty"`
  6. Key string `json:"key,omitempty"`
  7. AdditionalData string `json:"additional_data,omitempty"`
  8. }
  9. func (s *baseSecret) GetStatus() SecretStatus {
  10. return s.Status
  11. }
  12. func (s *baseSecret) GetPayload() string {
  13. return s.Payload
  14. }
  15. func (s *baseSecret) GetKey() string {
  16. return s.Key
  17. }
  18. func (s *baseSecret) GetAdditionalData() string {
  19. return s.AdditionalData
  20. }
  21. func (s *baseSecret) SetKey(value string) {
  22. s.Key = value
  23. }
  24. func (s *baseSecret) SetAdditionalData(value string) {
  25. s.AdditionalData = value
  26. }
  27. func (s *baseSecret) SetStatus(value SecretStatus) {
  28. s.Status = value
  29. }
  30. func (s *baseSecret) isEmpty() bool {
  31. if s.Status != "" {
  32. return false
  33. }
  34. if s.Payload != "" {
  35. return false
  36. }
  37. if s.Key != "" {
  38. return false
  39. }
  40. if s.AdditionalData != "" {
  41. return false
  42. }
  43. return true
  44. }