1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

improve cache handling

This commit is contained in:
checktheroads
2020-04-16 23:43:02 -07:00
parent fa38d49a8e
commit 400685304f
15 changed files with 210 additions and 355 deletions

View File

@@ -1,9 +1,9 @@
"""Response model."""
# Standard Library
from typing import List
from typing import List, Optional
# Third Party
from pydantic import BaseModel, StrictStr, StrictBool, constr
from pydantic import BaseModel, StrictInt, StrictStr, StrictBool, constr
# Project
from hyperglass.configuration import params
@@ -14,6 +14,7 @@ class QueryError(BaseModel):
output: StrictStr = params.messages.general
level: constr(regex=r"(success|warning|error|danger)") = "danger"
id: Optional[StrictStr]
keywords: List[StrictStr] = []
class Config:
@@ -56,6 +57,9 @@ class QueryResponse(BaseModel):
output: StrictStr
level: constr(regex=r"success") = "success"
id: StrictStr
cached: StrictBool
runtime: StrictInt
keywords: List[StrictStr] = []
class Config: