Documentation ¶
Index ¶
- Constants
- type CoverByPositionEncrypter
- type CoverByStrEncrypter
- type CoverFullEncrypter
- type DecrptHandler
- type EncrypHandler
- type EncryptRule
- type Encrypter
- type FpeEncrypter
- type HashHMACEncrypter
- type HashSHA1Encrypter
- type HashSHA256Encrypter
- type QpsManager
- type ReplacerByStrEncrypter
- type ReplacerFullEncrypter
- type SmartEncrypter
- func (s *SmartEncrypter) AddOrUpdate(rule *EncryptRule)
- func (s *SmartEncrypter) DeleteById(id int64)
- func (s *SmartEncrypter) DisableById(id int64)
- func (s *SmartEncrypter) EnableById(id int64)
- func (g *SmartEncrypter) HandleByRule(name string, value interface{}) (interface{}, error)
- func (g *SmartEncrypter) HandleVersaByRule(name string, value interface{}) (interface{}, error)
- func (s *SmartEncrypter) Init(rules []*EncryptRule)
- func (g *SmartEncrypter) Match(value interface{}) string
- type SourceIPRange
- type TransformForDate
- type TransformForFloat
- type TransformForString
Constants ¶
View Source
const ( Encrpt_Type_Hash int32 = iota + 1 Encrpt_Type_Cover Encrpt_Type_Replace Encrpt_Type_Transform )
View Source
const ( Encrpt_SubType_Hash_Sha1 int32 = Encrpt_Type_Hash<<16 + iota + 1 Encrpt_SubType_Hash_Sha256 Encrpt_SubType_Hash_Hmac )
View Source
const ( Encrpt_SubType_Cover_Full int32 = Encrpt_Type_Cover<<16 + iota + 1 Encrpt_SubType_Cover_ByPos Encrpt_SubType_Cover_ByStr )
View Source
const ( Encrpt_SubType_Replace_Full int32 = Encrpt_Type_Replace<<16 + iota + 1 Encrpt_SubType_Replace_ByStr Encrpt_SubType_Replace_FPE )
View Source
const ( Encrpt_SubType_Transform_ForFloat int32 = Encrpt_Type_Transform<<16 + iota + 1 Encrpt_SubType_Transform_ForDate Encrpt_SubType_Transform_ForStr )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoverByPositionEncrypter ¶
func (*CoverByPositionEncrypter) Handle ¶
func (h *CoverByPositionEncrypter) Handle(input interface{}) (interface{}, error)
func (*CoverByPositionEncrypter) Init ¶
func (h *CoverByPositionEncrypter) Init()
type CoverByStrEncrypter ¶
type CoverByStrEncrypter struct { Replacer string Strings []string RandomSelect bool // contains filtered or unexported fields }
func (*CoverByStrEncrypter) Handle ¶
func (h *CoverByStrEncrypter) Handle(input interface{}) (interface{}, error)
func (*CoverByStrEncrypter) Init ¶
func (h *CoverByStrEncrypter) Init()
type CoverFullEncrypter ¶
func (*CoverFullEncrypter) Handle ¶
func (h *CoverFullEncrypter) Handle(input interface{}) (interface{}, error)
func (*CoverFullEncrypter) Init ¶
func (h *CoverFullEncrypter) Init()
type DecrptHandler ¶
type DecrptHandler interface {
HandleVersa(input interface{}) (interface{}, error)
}
type EncrypHandler ¶
type EncrypHandler interface { Init() Handle(input interface{}) (interface{}, error) }
type EncryptRule ¶
type EncryptRule struct { Id int64 `xorm:"pk autoincr"` Name string `xorm:"unique"` Title string Description string Matcher string Encrypter *Encrypter `xorm:"json"` Disabled bool //默认为启动状态,加强防护 // contains filtered or unexported fields }
智能脱敏配置规则
func (*EncryptRule) Handle ¶
func (e *EncryptRule) Handle(value interface{}) (interface{}, error)
func (*EncryptRule) HandleVersa ¶
func (e *EncryptRule) HandleVersa(value interface{}) (interface{}, error)
func (*EncryptRule) Init ¶
func (e *EncryptRule) Init()
func (*EncryptRule) Match ¶
func (e *EncryptRule) Match(value interface{}) bool
func (*EncryptRule) SupportDecrpt ¶
func (e *EncryptRule) SupportDecrpt() bool
type Encrypter ¶
type Encrypter struct { Type int32 Encrypter EncrypHandler Decrypter DecrptHandler }
func (*Encrypter) MarshalJSON ¶
func (*Encrypter) UnmarshalJSON ¶
func (*Encrypter) UnmarshalYAML ¶
type FpeEncrypter ¶
func (*FpeEncrypter) Handle ¶
func (h *FpeEncrypter) Handle(input interface{}) (interface{}, error)
func (*FpeEncrypter) HandleVersa ¶
func (h *FpeEncrypter) HandleVersa(input interface{}) (interface{}, error)
func (*FpeEncrypter) Init ¶
func (h *FpeEncrypter) Init()
type HashHMACEncrypter ¶
func (*HashHMACEncrypter) Handle ¶
func (h *HashHMACEncrypter) Handle(input interface{}) (interface{}, error)
func (*HashHMACEncrypter) Init ¶
func (h *HashHMACEncrypter) Init()
type HashSHA1Encrypter ¶
type HashSHA1Encrypter struct { }
func (*HashSHA1Encrypter) Handle ¶
func (h *HashSHA1Encrypter) Handle(input interface{}) (interface{}, error)
func (*HashSHA1Encrypter) Init ¶
func (h *HashSHA1Encrypter) Init()
type HashSHA256Encrypter ¶
type HashSHA256Encrypter struct { }
func (*HashSHA256Encrypter) Handle ¶
func (h *HashSHA256Encrypter) Handle(input interface{}) (interface{}, error)
func (*HashSHA256Encrypter) Init ¶
func (h *HashSHA256Encrypter) Init()
type QpsManager ¶
func (*QpsManager) Init ¶
func (q *QpsManager) Init()
type ReplacerByStrEncrypter ¶
type ReplacerByStrEncrypter struct { Strings map[string]string // contains filtered or unexported fields }
func (*ReplacerByStrEncrypter) Handle ¶
func (h *ReplacerByStrEncrypter) Handle(input interface{}) (interface{}, error)
func (*ReplacerByStrEncrypter) Init ¶
func (h *ReplacerByStrEncrypter) Init()
type ReplacerFullEncrypter ¶
type ReplacerFullEncrypter struct {
Replacer string
}
func (*ReplacerFullEncrypter) Handle ¶
func (h *ReplacerFullEncrypter) Handle(input interface{}) (interface{}, error)
func (*ReplacerFullEncrypter) Init ¶
func (h *ReplacerFullEncrypter) Init()
type SmartEncrypter ¶
type SmartEncrypter struct {
Rules map[string]*EncryptRule
}
func (*SmartEncrypter) AddOrUpdate ¶
func (s *SmartEncrypter) AddOrUpdate(rule *EncryptRule)
AddOrUpdate 添加或更新规则
func (*SmartEncrypter) DeleteById ¶
func (s *SmartEncrypter) DeleteById(id int64)
func (*SmartEncrypter) DisableById ¶
func (s *SmartEncrypter) DisableById(id int64)
func (*SmartEncrypter) EnableById ¶
func (s *SmartEncrypter) EnableById(id int64)
func (*SmartEncrypter) HandleByRule ¶
func (g *SmartEncrypter) HandleByRule(name string, value interface{}) (interface{}, error)
func (*SmartEncrypter) HandleVersaByRule ¶
func (g *SmartEncrypter) HandleVersaByRule(name string, value interface{}) (interface{}, error)
func (*SmartEncrypter) Init ¶
func (s *SmartEncrypter) Init(rules []*EncryptRule)
func (*SmartEncrypter) Match ¶
func (g *SmartEncrypter) Match(value interface{}) string
type SourceIPRange ¶
type TransformForDate ¶
func (*TransformForDate) Handle ¶
func (h *TransformForDate) Handle(input interface{}) (interface{}, error)
func (*TransformForDate) Init ¶
func (h *TransformForDate) Init()
type TransformForFloat ¶
type TransformForFloat struct { Fixed int // contains filtered or unexported fields }
func (*TransformForFloat) Handle ¶
func (h *TransformForFloat) Handle(input interface{}) (interface{}, error)
func (*TransformForFloat) Init ¶
func (h *TransformForFloat) Init()
type TransformForString ¶
type TransformForString struct { Locs [][2]int16 Formate []int // contains filtered or unexported fields }
从选定的位置获取字符,组成新的字符,并按位设置到新的位置,比如Formate设置为135790246,则按位取原数据拼成新数据
func (*TransformForString) Handle ¶
func (h *TransformForString) Handle(input interface{}) (interface{}, error)
func (*TransformForString) Init ¶
func (h *TransformForString) Init()
Click to show internal directories.
Click to hide internal directories.