WIP: Custom unmarshal?
This commit is contained in:
parent
6503b0a94c
commit
6d8fcee025
15
config.go
15
config.go
@ -13,6 +13,21 @@ type Config struct {
|
||||
Rules []BrowserRuleConfig
|
||||
}
|
||||
|
||||
func (r *BrowserRule) UnmarshalJSON(data []byte) error {
|
||||
var values struct {
|
||||
command string
|
||||
args []string
|
||||
matchHostname []string
|
||||
matchHostRegexp []string
|
||||
matchRegexp []string
|
||||
}
|
||||
if err := json.Unmarshal(data, &values); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// BrowserRuleConfig represents a BrowserRule
|
||||
type BrowserRuleConfig struct {
|
||||
BrowserCommand []string
|
||||
|
Loading…
Reference in New Issue
Block a user