refactor(mail): modernize smtp sending with go-mail and unify message gateway pusher

This commit is contained in:
ryan
2026-09-02 21:59:47 +08:00
parent 88ed98b013
commit cf0cba0679
11 changed files with 298 additions and 342 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ func formatEntryValue(value any, secret bool) string {
return ""
}
rv := reflect.ValueOf(value)
if rv.Kind() == reflect.Ptr {
if rv.Kind() == reflect.Pointer {
if rv.IsNil() {
return ""
}
+2 -2
View File
@@ -33,7 +33,7 @@ func convertValue(raw any, typ reflect.Type) (any, error) {
return convertSlice(raw, typ)
case reflect.Struct:
return convertStruct(raw, typ)
case reflect.Ptr:
case reflect.Pointer:
return convertPointer(raw, typ)
default:
return nil, fmt.Errorf("%w: %s is not a supported configuration type", ErrConfigType, typ)
@@ -44,7 +44,7 @@ func convertValue(raw any, typ reflect.Type) (any, error) {
// Nested pointers are rejected so configuration tags stay one level deep.
func convertPointer(raw any, typ reflect.Type) (any, error) {
elemType := typ.Elem()
if elemType.Kind() == reflect.Ptr {
if elemType.Kind() == reflect.Pointer {
return nil, fmt.Errorf("%w: %s is not a supported configuration type", ErrConfigType, typ)
}
elem, err := convertValue(raw, elemType)