Help us shape the future of Go! Take the 2026 Go Developer Survey

valueobjects

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	// contains filtered or unexported fields
}

Email represents an email address value object

func NewEmail

func NewEmail(value string) (Email, error)

NewEmail creates a new Email value object

func (Email) Domain

func (e Email) Domain() string

Domain returns the domain part of the email

func (Email) Equal

func (e Email) Equal(other Email) bool

Equal checks if two emails are equal

func (Email) LocalPart

func (e Email) LocalPart() string

LocalPart returns the local part of the email

func (Email) MarshalJSON

func (e Email) MarshalJSON() ([]byte, error)

MarshalJSON exposes the address, never the internal representation.

func (*Email) Scan

func (e *Email) Scan(src any) error

Scan validates before replacing the address. SQL NULL is invalid for Email.

func (Email) String

func (e Email) String() string

String returns the string representation

func (*Email) UnmarshalJSON

func (e *Email) UnmarshalJSON(data []byte) error

UnmarshalJSON validates and normalizes before replacing the value.

func (Email) Valid

func (e Email) Valid() bool

func (Email) Value

func (e Email) Value() (driver.Value, error)

Value implements driver.Valuer. Invalid zero values cannot be persisted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL