hat.syslog.server.common

Common data structures

 1"""Common data structures"""
 2
 3import importlib.resources
 4import typing
 5
 6from hat import json
 7from hat.syslog.common import (Facility,
 8                               Msg,
 9                               Severity)
10from hat.syslog.common import *  # NOQA
11
12
13with importlib.resources.path(__package__, 'json_schema_repo.json') as _path:
14    json_schema_repo: json.SchemaRepository = json.SchemaRepository(
15        json.json_schema_repo,
16        json.SchemaRepository.from_json(_path))
17    """JSON schema repository"""
18
19
20class Entry(typing.NamedTuple):
21    id: int
22    timestamp: float
23    msg: Msg
24
25
26class Filter(typing.NamedTuple):
27    max_results: typing.Optional[int] = None
28    last_id: typing.Optional[int] = None
29    entry_timestamp_from: typing.Optional[float] = None
30    entry_timestamp_to: typing.Optional[float] = None
31    facility: typing.Optional[Facility] = None
32    severity: typing.Optional[Severity] = None
33    hostname: typing.Optional[str] = None
34    app_name: typing.Optional[str] = None
35    procid: typing.Optional[str] = None
36    msgid: typing.Optional[str] = None
37    msg: typing.Optional[str] = None
class Entry(typing.NamedTuple):
21class Entry(typing.NamedTuple):
22    id: int
23    timestamp: float
24    msg: Msg

Entry(id, timestamp, msg)

Entry(id: int, timestamp: float, msg: hat.syslog.common.Msg)

Create new instance of Entry(id, timestamp, msg)

id: int

Alias for field number 0

timestamp: float

Alias for field number 1

Alias for field number 2

Inherited Members
builtins.tuple
index
count
class Filter(typing.NamedTuple):
27class Filter(typing.NamedTuple):
28    max_results: typing.Optional[int] = None
29    last_id: typing.Optional[int] = None
30    entry_timestamp_from: typing.Optional[float] = None
31    entry_timestamp_to: typing.Optional[float] = None
32    facility: typing.Optional[Facility] = None
33    severity: typing.Optional[Severity] = None
34    hostname: typing.Optional[str] = None
35    app_name: typing.Optional[str] = None
36    procid: typing.Optional[str] = None
37    msgid: typing.Optional[str] = None
38    msg: typing.Optional[str] = None

Filter(max_results, last_id, entry_timestamp_from, entry_timestamp_to, facility, severity, hostname, app_name, procid, msgid, msg)

Filter( max_results: Optional[int] = None, last_id: Optional[int] = None, entry_timestamp_from: Optional[float] = None, entry_timestamp_to: Optional[float] = None, facility: Optional[hat.syslog.common.Facility] = None, severity: Optional[hat.syslog.common.Severity] = None, hostname: Optional[str] = None, app_name: Optional[str] = None, procid: Optional[str] = None, msgid: Optional[str] = None, msg: Optional[str] = None)

Create new instance of Filter(max_results, last_id, entry_timestamp_from, entry_timestamp_to, facility, severity, hostname, app_name, procid, msgid, msg)

max_results: Optional[int]

Alias for field number 0

last_id: Optional[int]

Alias for field number 1

entry_timestamp_from: Optional[float]

Alias for field number 2

entry_timestamp_to: Optional[float]

Alias for field number 3

facility: Optional[hat.syslog.common.Facility]

Alias for field number 4

severity: Optional[hat.syslog.common.Severity]

Alias for field number 5

hostname: Optional[str]

Alias for field number 6

app_name: Optional[str]

Alias for field number 7

procid: Optional[str]

Alias for field number 8

msgid: Optional[str]

Alias for field number 9

msg: Optional[str]

Alias for field number 10

Inherited Members
builtins.tuple
index
count
json_schema_repo: hat.json.repository.SchemaRepository = <hat.json.repository.SchemaRepository object>