diff --git a/define.go b/define/strategy_type.go similarity index 97% rename from define.go rename to define/strategy_type.go index c0aece3..163ef95 100644 --- a/define.go +++ b/define/strategy_type.go @@ -5,7 +5,7 @@ // Author : go_developer@163.com<白茶清欢> // // Date : 2023-05-23 14:26 -package data_mask +package define const ( // TypeDefault 默认实现 diff --git a/go.mod b/go.mod index 03cd096..8faba67 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module git.zhangdeman.cn/zhangdeman/data_mask -go 1.20 +go 1.21 diff --git a/mail.go b/strategy/mail.go similarity index 85% rename from mail.go rename to strategy/mail.go index d0581b9..14162ff 100644 --- a/mail.go +++ b/strategy/mail.go @@ -5,9 +5,12 @@ // Author : go_developer@163.com<白茶清欢> // // Date : 2023-05-24 14:40 -package data_mask +package strategy -import "strings" +import ( + "git.zhangdeman.cn/zhangdeman/data_mask/define" + "strings" +) // MailDataMask ... // @@ -32,5 +35,5 @@ func (m MailDataMask) Mask(input string) string { } func (m MailDataMask) Type() string { - return TypeMail + return define.TypeMail } diff --git a/mail_test.go b/strategy/mail_test.go similarity index 96% rename from mail_test.go rename to strategy/mail_test.go index 8e3e1f2..a16a909 100644 --- a/mail_test.go +++ b/strategy/mail_test.go @@ -5,7 +5,7 @@ // Author : go_developer@163.com<白茶清欢> // // Date : 2023-05-24 14:47 -package data_mask +package strategy import ( "fmt" diff --git a/password.go b/strategy/password.go similarity index 74% rename from password.go rename to strategy/password.go index 54dbdd0..c506bd7 100644 --- a/password.go +++ b/strategy/password.go @@ -1,11 +1,15 @@ -// Package data_mask ... +// Package strategy ... // // Description : data_mask ... // // Author : go_developer@163.com<白茶清欢> // // Date : 2023-05-24 15:02 -package data_mask +package strategy + +import ( + "git.zhangdeman.cn/zhangdeman/data_mask/define" +) // PasswordDataMask 密码数据脱敏 // @@ -20,5 +24,5 @@ func (p PasswordDataMask) Mask(input string) string { } func (p PasswordDataMask) Type() string { - return TypePassword + return define.TypePassword } diff --git a/phone.go b/strategy/phone.go similarity index 84% rename from phone.go rename to strategy/phone.go index 25ba097..f272602 100644 --- a/phone.go +++ b/strategy/phone.go @@ -1,13 +1,16 @@ -// Package data_mask ... +// Package strategy ... // // Description : data_mask ... // // Author : go_developer@163.com<白茶清欢> // // Date : 2023-05-24 14:52 -package data_mask +package strategy -import "regexp" +import ( + "git.zhangdeman.cn/zhangdeman/data_mask/define" + "regexp" +) // PhoneDataMask ... // @@ -34,5 +37,5 @@ func (p PhoneDataMask) Mask(input string) string { } func (p PhoneDataMask) Type() string { - return TypePhone + return define.TypePhone } diff --git a/phone_test.go b/strategy/phone_test.go similarity index 94% rename from phone_test.go rename to strategy/phone_test.go index a5c3bf0..97b64dd 100644 --- a/phone_test.go +++ b/strategy/phone_test.go @@ -5,7 +5,7 @@ // Author : go_developer@163.com<白茶清欢> // // Date : 2023-05-24 14:57 -package data_mask +package strategy import ( "fmt"