Class GestaltGraph

Hierarchy

  • CreateDestroyStartStop
    • GestaltGraph

Constructors

Properties

[initLock]: RWLockWriter
acl: ACL
db: DB
dbIdentitiesPath: readonly (string | Buffer)[] = ...

Identity information GestaltGraph/identities/{GestaltKey} -> {json(GestaltIdentityInfo)}

dbLinksPath: readonly (string | Buffer)[] = ...

Gestalt links. GestaltGraph/links/{GestaltLinkId} -> {json(GestaltLink)}

dbMatrixPath: readonly (string | Buffer)[] = ...

Gestalt adjacency matrix represented as a collection vertex pairs. Each vertex can be GestaltNodeKey or GestaltIdentityKey. These are the allowable structures: GestaltGraph/matrix/{GestaltKey} -> null GestaltGraph/matrix/{GestaltKey}/{GestaltKey} -> {raw(GestaltLinkId)}

dbNodesPath: readonly (string | Buffer)[] = ...

Node information GestaltGraph/nodes/{GestaltKey} -> {json(GestaltNodeInfo)}

dbPath: readonly (string | Buffer)[] = ...
generateGestaltLinkId: (() => GestaltLinkId)

Type declaration

logger: Logger

Accessors

  • get [destroyed](): boolean
  • Returns boolean

  • get [eventHandled](): ReadonlyWeakSet<Event>
  • Returns ReadonlyWeakSet<Event>

  • get [eventHandlers](): ReadonlyMap<string, Set<EventHandlerInfo>>
  • Returns ReadonlyMap<string, Set<EventHandlerInfo>>

  • get [eventTarget](): EventTarget
  • Returns EventTarget

  • get [handleEventError](): ((evt) => void)
  • Returns ((evt) => void)

      • (evt): void
      • Parameters

        • evt: EventError

        Returns void

  • get [running](): boolean
  • Returns boolean

  • get [statusP](): Promise<Status>
  • Returns Promise<Status>

  • get [status](): Status
  • Returns Status

Methods

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • event: Event

    Returns boolean

  • Parameters

    • gestaltId: GestaltId
    • Optional tran: DBTransaction

    Returns Promise<Partial<Record<"claim" | "notify" | "scan", null>>>

  • Gets a gestalt using BFS. During execution thevisited set indicates the vertexes that have been queued. This BFS algorithm has to 2 stages:

    1. processing the vertex information.
    2. processing the vertex links by iterating the vertex neighbours. When processing vertex information we need to avoid queued duplicate vertexes. When processing vertex links we need to avoid already processed links. When finished, the visited set indicates the vertexes that have been processed.

    Parameters

    • gestaltKey: GestaltKey
    • visited: Set<string> = ...
    • tran: DBTransaction

    Returns Promise<undefined | Gestalt>

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • gestaltId: GestaltId
    • action: "claim" | "notify" | "scan"
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Sets a node in the graph Can be used to update an existing node If this is a new node, it will set a new node pointer to a new gestalt permission in the acl

    Parameters

    Returns Promise<["node", NodeId]>

  • Parameters

    • __namedParameters: {
          fresh?: boolean;
      } = {}
      • Optional fresh?: boolean

    Returns Promise<void>

  • Parameters

    • gestaltId: GestaltId
    • action: "claim" | "notify" | "scan"
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • __namedParameters: {
          acl: ACL;
          db: DB;
          fresh?: boolean;
          logger?: Logger;
      }
      • acl: ACL
      • db: DB
      • Optional fresh?: boolean
      • Optional logger?: Logger

    Returns Promise<GestaltGraph>

Generated using TypeDoc