def __init__(self): self.name = StringLeaf('default') self.type = DNSResolverType.UDP.name self.ip_address = StringLeaf(RESOLVER_DEFAULT_UPSTREAM_IP_ADDRESS_V4) self.ip_address6 = StringLeaf() self.timeout = IntLeaf(RESOLVER_DEFAULT_TIMEOUT) self.proxy = StringLeaf() self.lifetime = IntLeaf(CACHE_DEFAULT_LIFETIME) # 60 * 15 = 15 minute super().__init__()
class AP(Branch): enabled = BooleanLeaf(True) channel = IntLeaf(1) password = StringLeaf('password') mac_acl_list = ListLeaf([ '00:00:00:00:00:00', ])
class Config(Root): version = StringLeaf('0.1.0') class Auth(Branch): username = StringLeaf('rex') password = StringLeaf('password') class Wireless(Branch): class AP(Branch): enabled = BooleanLeaf(True) channel = IntLeaf(1) password = StringLeaf('password') mac_acl_list = ListLeaf([ '00:00:00:00:00:00', ]) class NotExistBranch(Branch): pass not_exist_leaf = StringLeaf()
class Auth(Branch): username = StringLeaf('rex') password = StringLeaf('password')
class Service(Branch): bind = StringLeaf(DEFAULT_HOST) port = IntLeaf(DEFAULT_PORT)
class Common(Branch): sentry_dsn = StringLeaf()
class Default(Branch): resolver = StringLeaf('default')
class Cache(Branch): uri = StringLeaf(CACHE_DEFAULT_URI) storage_lifetime = IntLeaf(CACHE_DEFAULT_STORAGE_LIFETIME)