Go용 이메일 검증 SDK
무료 플랜이 가능합니다. 신용카드가 필요하지 않습니다.
Go Get 설정
EmailVerify Go 클라이언트를 프로젝트 종속성에 추가합니다.
go get github.com/Clustox/emailverifygo
사용 샘플
1 실시간 검증
Go를 위한 고성능 이메일 검증. 당사의 SDK는 가볍고 빠르도록 설계되었으며 실시간 유효성 검사를 위한 스레드 안전(thread-safe) 작업을 제공합니다.
import "github.com/Clustox/emailverifygo"
client := emailverifygo.NewClient("your_api_key")
res, err := client.Validate("[email protected]")
if err == nil && res.Status == "valid" {
fmt.Println("Safe to send!")
}
2 대규모 배치 전송
차단 없이 대규모 데이터 세트를 처리합니다. Go 배치 클라이언트를 사용하면 백그라운드 검증을 위해 대량의 이메일 슬라이스를 제출할 수 있습니다.
emails :=[]string{"[email protected]", "[email protected]"}
batch, _ := client.ValidateBatch(emails, "My Task")
// Poll or use webhooks
status, _ := client.GetTaskStatus(batch.TaskID)
if status.State == "finished" {
results, _ := client.GetTaskResults(batch.TaskID)
fmt.Printf("Processed %d emails\n", len(results))
}
3 고급 클라이언트 및 컨텍스트
엔터프라이즈 지원 구성. 취소 및 시간 초과를 위한 Go의 context 패턴을 완벽하게 지원합니다.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
// Advanced config with custom HTTP client
client := emailverifygo.NewClient("key")
client.HTTPClient.Timeout = 10 * time.Second
res, err := client.ValidateWithContext(ctx, "[email protected]")
4 AI 기반 이메일 파인더
전문적인 리드 발굴. Finder API를 사용하여 이름과 도메인에서 기관 이메일 주소를 확인합니다.
lead, err := client.FindEmail("Larry Page", "google.com")
if err == nil && lead.Status == "found" {
fmt.Printf("Found: %s (Confidence: %d%%)\n", lead.Email, lead.Confidence)
}
5 실시간 구문 수정
사용자 마찰을 최소화합니다. 실시간으로 일반적인 이메일 오타를 자동으로 감지하고 수정을 제안합니다.
check, _ := client.ValidateSyntax("[email protected]")
if check.Suggestion != "" {
fmt.Printf("Typo detected! Did you mean %s?\n", check.Suggestion)
}
6 동시 배치 검증
속도를 위해 제작되었습니다. Go의 고루틴을 활용하여 여러 실시간 검증을 병렬로 수행합니다.
var wg sync.WaitGroup
emails :=[]string{"[email protected]", "[email protected]", "[email protected]"}
for _, email := range emails {
wg.Add(1)
go func(e string) {
defer wg.Done()
res, _ := client.Validate(e)
fmt.Println(res.Status)
}(email)
}
wg.Wait()
7 강력한 형식 안전(Type-Safe) 오류
우아한 오류 관리. 모든 API 실패는 정확한 실패 모드 감지를 위해 구조화된 오류 유형으로 반환됩니다.
res, err := client.Validate(email)
if err != nil {
if apiErr, ok := err.(*emailverifygo.APIError); ok {
fmt.Printf("Status: %d, Message: %s", apiErr.Code, apiErr.Message)
}
}
8 스팸 및 보안 감지
평판을 보호하세요. 일회용 이메일 서비스 및 알려진 스팸 트랩이 서버에 접속하기 전에 감지하고 차단합니다.
res, _ := client.Validate("[email protected]")
if res.IsDisposable || res.IsSpamTrap {
log.Printf("High risk email: %s", res.Email)
}
fmt.Printf("Provider: %s", res.DomainInfo.Provider)
자주 묻는 질문
Go SDK는 스레드로부터 안전합니까?
예, Go 클라이언트는 스레드로부터 안전하도록 설계되었으며 여러 고루틴에서 안전하게 공유할 수 있습니다.
Go SDK에서 오류를 어떻게 처리합니까?
SDK는 표준 Go 오류 처리 패턴을 따릅니다. 모든 API 메서드는 결과와 오류 객체를 반환합니다.
SDK는 컨텍스트를 지원합니까?
예, 당사의 최신 Go SDK는 컨텍스트 전파를 지원하여 요청 시간 초과를 효과적으로 관리할 수 있습니다.
높은 동시성 유효성 검사에 사용할 수 있습니까?
물론입니다. Go SDK는 고성능에 최적화되어 있으며 높은 동시성 마이크로서비스에 이상적입니다.