diff options
| author | Bobby <[email protected]> | 2026-03-07 17:59:31 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-07 17:59:31 +0530 |
| commit | a6ec9a807df68978bf3b85314a4c54c60ecc2b7a (patch) | |
| tree | 6201e8d594a3c368cce50ebc402f248814e2025f /utils/meta/value.go | |
| parent | 57df54999e778887e66775481dab46191b46d0b6 (diff) | |
| download | dove-a6ec9a807df68978bf3b85314a4c54c60ecc2b7a.tar.xz dove-a6ec9a807df68978bf3b85314a4c54c60ecc2b7a.zip | |
feat: implement SMTP server with authentication, port validation, and email storage
Diffstat (limited to 'utils/meta/value.go')
| -rw-r--r-- | utils/meta/value.go | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/utils/meta/value.go b/utils/meta/value.go index fb90500..889ba0e 100644 --- a/utils/meta/value.go +++ b/utils/meta/value.go @@ -5,25 +5,30 @@ import ( "dove/utils/logger" ) -func (self value) String() string { +func (self *value) String() string { + if self == nil { + return "" + } + return self.data } -func (self value) Exists() bool { - return self.found +func (self *value) Exists() bool { + return self != nil } -func (self value) Or(fallback string) string { - if self.found { - return self.data +func (self *value) Or(fallback string) string { + if self == nil { + return fallback } - return fallback + return self.data } -func (self value) Required() string { - if !self.found { +func (self *value) Required() string { + if self == nil { logger.Errorf(LOG_PREFIX, messages.MetaRequiredValueMissing) + return "" } return self.data |
