Attention

This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.

Models (harp.models)

The Models (harp.models) package define the base models for Harp, without any opinion on whether the represented data will or should be stored, nor how it should be stored.

Contents

class Blob[source]

Bases: Entity

Blob(*, id: str, data: bytes, content_type: str = None)

__init__(*, id, data, content_type=None)
Parameters:
Return type:

None

classmethod from_data(data, /, *, content_type=None)[source]
prettify()[source]
content_type: str = None
data: bytes
id: str
class Entity[source]

Bases: JsonSchemaMixin

id: Any
class Message[source]

Bases: Entity

Message(*, id: int = None, transaction_id: str, kind: str, summary: str, headers: str, body: str, created_at: datetime.datetime = None)

__init__(*, id=None, transaction_id, kind, summary, headers, body, created_at=None)
Parameters:
Return type:

None

body: str
created_at: datetime = None
headers: str
id: int = None
kind: str
summary: str
transaction_id: str
class Results[source]

Bases: Generic[TResult]

__init__()[source]
append(item)[source]
Parameters:

item (TResult)

class Transaction[source]

Bases: Entity

Transaction(*, id: str = None, type: str, endpoint: str = None, started_at: datetime.datetime, finished_at: datetime.datetime = None, elapsed: float = None, tpdex: int = None, messages: List[harp.models.messages.Message] = None, tags: dict = <factory>, extras: dict = <factory>)

__init__(*, id=None, type, endpoint=None, started_at, finished_at=None, elapsed=None, tpdex=None, messages=None, tags=<factory>, extras=<factory>)
Parameters:
Return type:

None

elapsed: float = None

Elapsed time in seconds, if the transaction has ended.

endpoint: str = None

Endpoint name, if any (this describes which proxy controller handled the request).

extras: dict
finished_at: datetime = None

Timestamp of the transaction end (if it has ended), or None.

id: str = None

Unique identifier for this transaction.

messages: List[Message] = None
started_at: datetime

Timestamp of the transaction start.

tags: dict
tpdex: int = None

TPDEX score, if the transaction has ended.

type: str

Type of ASGI transaction: http, websocket, lifecycle, …

Submodules