Documentation ¶
Overview ¶
Package mask implements Mask API
Index ¶
Constants ¶
View Source
const ( MASKTYPE_CHAR = "CHAR" // 用字符替换敏感信息,需要用到后面更详细的配置项。 MASKTYPE_TAG = "TAG" // 用识别和处理规则中的InfoType, 以`<InfoType>`的形式替换敏感信息。 MASKTYPE_REPLACE = "REPLACE" //用Value定义的字符串,替换敏感信息,可以设定为空串,用于直接抹除。 MASKTYPE_ALGO = "ALGO" //用Value定义的算法函数,处理敏感信息,用算法返回值替换原文,目前支持的算法有 [BASE64, MD5, CRC32] MASK_ALGO_BASE64 = "BASE64" MASK_ALGO_MD5 = "MD5" MASK_ALGO_CRC32 = "CRC32" MASK_UNKNOWN_TAG = "UNKNOWN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MaskAPI ¶
type MaskAPI interface { // GetRuleName return RuleName of a MaskWorker // 返回RuleName GetRuleName() string // Mask will return masked string // 返回打码后的文本 Mask(string) (string, error) // MaskResult will modify DetectResult.MaskText // 修改DetectResult.MaskText MaskResult(*dlpheader.DetectResult) error }
func NewMaskWorker ¶
NewMaskWorker create MaskWorker based on MaskRule
type MaskWorker ¶
type MaskWorker struct {
// contains filtered or unexported fields
}
func (*MaskWorker) GetRuleName ¶
func (I *MaskWorker) GetRuleName() string
GetRuleName return RuleName of a MaskWorker 返回RuleName
func (*MaskWorker) Mask ¶
func (I *MaskWorker) Mask(in string) (string, error)
Mask will return masked string 返回打码后的文本
func (*MaskWorker) MaskResult ¶
func (I *MaskWorker) MaskResult(res *dlpheader.DetectResult) error
MaskResult will modify DetectResult.MaskText 修改DetectResult.MaskText
Click to show internal directories.
Click to hide internal directories.