json.go 344 B

123456789101112131415161718
  1. package json
  2. import (
  3. "encoding/json"
  4. )
  5. type RouterConfig struct {
  6. StrategyValue string `json:"strategy"`
  7. SettingsValue json.RawMessage `json:"settings"`
  8. }
  9. func (this *RouterConfig) Strategy() string {
  10. return this.StrategyValue
  11. }
  12. func (this *RouterConfig) Settings() interface{} {
  13. return CreateRouterConfig(this.Strategy())
  14. }