Ignored attribute
This commit is contained in:
parent
e7d10843db
commit
0baecc0a6f
|
@ -30,6 +30,7 @@ const (
|
|||
tOptions = "options"
|
||||
aRequired = "required"
|
||||
aReadonly = "readonly"
|
||||
aIgnored = "ignored"
|
||||
sep = ","
|
||||
)
|
||||
|
||||
|
@ -68,6 +69,7 @@ func (c *config) meta(prefix string) []*configField {
|
|||
panic(fmt.Errorf("Config is expected to be a Struct, not %s", ckind.String()))
|
||||
}
|
||||
|
||||
loop_over_fields:
|
||||
for i := 0; i < cval.NumField(); i++ {
|
||||
var (
|
||||
field = ctyp.Field(i)
|
||||
|
@ -105,6 +107,9 @@ func (c *config) meta(prefix string) []*configField {
|
|||
if attr == aReadonly {
|
||||
cf.IsReadonly = true
|
||||
}
|
||||
if attr == aIgnored {
|
||||
continue loop_over_fields
|
||||
}
|
||||
}
|
||||
|
||||
fields = append(fields, cf)
|
||||
|
|
|
@ -13,6 +13,7 @@ type (
|
|||
EnableSignIn bool `json:"enable_sign_in" title:"Enable Sign-In"`
|
||||
DatabaseDriver string `json:"database_driver" title:"Database Driver" options:"mysql,postgresql,mssql"`
|
||||
DatabaseConfig DatabaseConfig `json:"database_config"`
|
||||
SensitiveData string `json:"sensitive_data" attrs:"ignored"`
|
||||
}
|
||||
DatabaseConfig struct {
|
||||
Hostname string `json:"hostname"`
|
||||
|
|
Loading…
Reference in New Issue