Go 版 mask-pii

mask-pii 的 Go 實作,用於在日誌與資料管線中遮罩電子郵件和電話個資。

電子郵件遮罩

在保留網域可見性的同時遮罩本地部分。

電話遮罩

在保留格式與後四碼可見性的同時遮罩敏感數字。

建構器式 API

在處理前明確啟用電子郵件/電話遮罩與遮罩字元。

安裝與開始

Go [published: Go Module Proxy / pkg.go.dev 0.2.0]: 使用下方目前的安裝方式,載入 Go API 並執行最小範例。此範例會明確啟用電子郵件與電話號碼遮罩,並顯示預期輸出。

安裝

go get github.com/finitefield-org/mask-pii/go@v0.2.0

用法

main.go
package main

import (
	"fmt"

	"github.com/finitefield-org/mask-pii/go"
)

func main() {
	masker := maskpii.New()
		.MaskEmails()
		.MaskPhones()
		.WithMaskChar('#')

	input := "Contact: alice@example.com or 090-1234-5678."
	output := masker.Process(input)

	fmt.Println(output)
	// Output: "Contact: a####@example.com or ###-####-5678."
}
注意

請檢視 README ,以取得此語言的套件生態系細節與 API 範例。

上一頁

語言索引

下一頁

GitHub