undoing the rookie things I did

This commit is contained in:
Samuel Hawksby-Robinson 2022-08-19 14:38:34 +01:00
parent 5484b7ef9d
commit 06f4b85792
2 changed files with 8 additions and 9 deletions

View File

@ -8,13 +8,13 @@ import (
) )
type IdentityImage struct { type IdentityImage struct {
KeyUID string `json:"key_uid"` KeyUID string `json:"keyUID"`
Name string `json:"name"` Name string `json:"name"`
Payload []byte `json:"payload"` Payload []byte `json:"payload"`
Width int `json:"width"` Width int `json:"width"`
Height int `json:"height"` Height int `json:"height"`
FileSize int `json:"file_size"` FileSize int `json:"fileSize"`
ResizeTarget int `json:"resize_target"` ResizeTarget int `json:"resizeTarget"`
Clock uint64 `json:"clock"` Clock uint64 `json:"clock"`
} }
@ -65,8 +65,5 @@ func (i IdentityImage) MarshalJSON() ([]byte, error) {
} }
func (i IdentityImage) IsEmpty() bool { func (i IdentityImage) IsEmpty() bool {
if i.KeyUID == "" && i.Name == "" && len(i.Payload) == 0 && i.Width == 0 && i.Height == 0 && i.FileSize == 0 && i.ResizeTarget == 0 && i.Clock == 0 { return i.KeyUID == "" && i.Name == "" && len(i.Payload) == 0 && i.Width == 0 && i.Height == 0 && i.FileSize == 0 && i.ResizeTarget == 0 && i.Clock == 0
return true
}
return false
} }

View File

@ -31,7 +31,9 @@ type PayloadManager interface {
// PairingPayloadManagerConfig represents the initialisation parameters required for a PairingPayloadManager // PairingPayloadManagerConfig represents the initialisation parameters required for a PairingPayloadManager
type PairingPayloadManagerConfig struct { type PairingPayloadManagerConfig struct {
DB *multiaccounts.Database DB *multiaccounts.Database
KeystorePath, KeyUID, Password string KeystorePath string
KeyUID string
Password string
} }
// PairingPayloadManager is responsible for the whole lifecycle of a PairingPayload // PairingPayloadManager is responsible for the whole lifecycle of a PairingPayload