25 lines
506 B
Go
25 lines
506 B
Go
package mzap
|
|
|
|
import (
|
|
"github.com/tech/sendico/pkg/model"
|
|
"github.com/tech/sendico/pkg/mutil/mask"
|
|
"go.mongodb.org/mongo-driver/v2/bson"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func AccRef(accountRef bson.ObjectID) zap.Field {
|
|
return ObjRef("account_ref", accountRef)
|
|
}
|
|
|
|
func Email(email string) zap.Field {
|
|
return MaskEmail("email", email)
|
|
}
|
|
|
|
func MaskEmail(field, email string) zap.Field {
|
|
return zap.String(field, mask.Email(email))
|
|
}
|
|
|
|
func Login(account *model.Account) zap.Field {
|
|
return Email(account.Login)
|
|
}
|