提交 d002d9c1 authored 作者: mooncake9527's avatar mooncake9527

extend cd

上级 195a10b3
...@@ -36,8 +36,7 @@ func (x *ConsulConfFetcher) fetch() error { ...@@ -36,8 +36,7 @@ func (x *ConsulConfFetcher) fetch() error {
} }
func (x *ConsulConfFetcher) sync() *ConsulConfFetcher { func (x *ConsulConfFetcher) sync() *ConsulConfFetcher {
consul := api.DefaultConfig() client, err := api.NewClient(api.DefaultConfig())
client, err := api.NewClient(consul)
if err != nil { if err != nil {
x.err = err x.err = err
return x return x
......
...@@ -10,6 +10,14 @@ import ( ...@@ -10,6 +10,14 @@ import (
type IDCard string type IDCard string
func NewIDCard(v string) IDCard {
return IDCard(v)
}
func (id IDCard) String() string {
return string(id)
}
// Mask 身份证号遮蔽处理(保留格式中的X) // Mask 身份证号遮蔽处理(保留格式中的X)
func (id IDCard) Mask() string { func (id IDCard) Mask() string {
s := string(id) s := string(id)
......
...@@ -8,6 +8,14 @@ import ( ...@@ -8,6 +8,14 @@ import (
type Mobile string type Mobile string
func NewMobile(v string) Mobile {
return Mobile(v)
}
func (id Mobile) String() string {
return string(id)
}
func (d *Mobile) MarshalCSV() (string, error) { func (d *Mobile) MarshalCSV() (string, error) {
if d == nil { if d == nil {
return "", nil return "", nil
......
...@@ -7,6 +7,14 @@ import ( ...@@ -7,6 +7,14 @@ import (
type Password string type Password string
func NewPassword(v string) Password {
return Password(v)
}
func (id Password) String() string {
return string(id)
}
func (d *Password) MarshalCSV() (string, error) { func (d *Password) MarshalCSV() (string, error) {
if d == nil { if d == nil {
return "******", nil return "******", nil
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论