-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve attachment struct names and use attachment type constants
- Loading branch information
Rheisen
committed
Mar 15, 2024
1 parent
bfe89f7
commit 6166f83
Showing
5 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package berr | ||
|
||
type detail struct { | ||
const AttachmentDetailType = "detail" | ||
|
||
type detailAttachment struct { | ||
key string | ||
value any | ||
} | ||
|
||
func (d detail) Key() string { | ||
func (d detailAttachment) Key() string { | ||
return d.key | ||
} | ||
|
||
func (d detail) Value() any { | ||
func (d detailAttachment) Value() any { | ||
return d.value | ||
} | ||
|
||
func (d detail) Type() string { | ||
return "berr_detail" | ||
func (d detailAttachment) Type() string { | ||
return AttachmentDetailType | ||
} | ||
|
||
func (d detail) Sensitive() bool { | ||
func (d detailAttachment) Sensitive() bool { | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package berr | ||
|
||
type errorDetail struct { | ||
const AttachmentErrorType = "error" | ||
|
||
type errorAttachment struct { | ||
key string | ||
value error | ||
} | ||
|
||
func (d errorDetail) Key() string { | ||
func (d errorAttachment) Key() string { | ||
return d.key | ||
} | ||
|
||
func (d errorDetail) Value() any { | ||
func (d errorAttachment) Value() any { | ||
return d.value | ||
} | ||
|
||
func (d errorDetail) Type() string { | ||
return "berr_error_detail" | ||
func (d errorAttachment) Type() string { | ||
return AttachmentErrorType | ||
} | ||
|
||
func (d errorDetail) Sensitive() bool { | ||
func (d errorAttachment) Sensitive() bool { | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package berr | ||
|
||
type metadataDetail struct { | ||
const AttachmentMetadataType = "metadata" | ||
|
||
type metadataAttachment struct { | ||
key string | ||
value any | ||
} | ||
|
||
func (d metadataDetail) Key() string { | ||
func (d metadataAttachment) Key() string { | ||
return d.key | ||
} | ||
|
||
func (d metadataDetail) Value() any { | ||
func (d metadataAttachment) Value() any { | ||
return d.value | ||
} | ||
|
||
func (d metadataDetail) Type() string { | ||
func (d metadataAttachment) Type() string { | ||
return "berr_metadata_detail" | ||
} | ||
|
||
func (d metadataDetail) Sensitive() bool { | ||
func (d metadataAttachment) Sensitive() bool { | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters