A simple in-memory store that stores data in a Map.

Hierarchy

  • EventEmitter
    • DefaultStore

Implements

Constructors

Properties

data: Map<string, TypedMap<SupportedRecordType, ZoneData>> = ...
shouldCache: boolean

Methods

  • Delete information about a zone in the database.

    If no type is provided, all data for the domain should be deleted. If no data is provided, all data of the given type should be deleted.

    Type Parameters

    Parameters

    • domain: string

      The domain to delete data from

    • Optionaltype: T

      Optional. The record type to delete

    • Optionaldata: ZoneData[T]

      Optional. The data to delete

    Returns void

  • Emit a cache request event.

    This event is emitted when the store asks any consumers to cache data.

    This event will be fired if the shouldCache option is set to true.

    Type Parameters

    Parameters

    • zone: string

      The zone to cache the record for

    • rType: T

      The record type to cache

    • records: ZoneData[T][]

      The records to cache

    Returns Promise<void>

  • Retrieve information about a zone in the database.

    Type Parameters

    Parameters

    • domain: string

      The domain to get

    • OptionalrType: T

      The record type to get

    • wildcards: boolean = true

      Whether to resolve wildcard records

    Returns null | (
        | CaaData
        | DnskeyData
        | DsData
        | HInfoData
        | MxData
        | NaptrData
        | NsecData
        | Nsec3Data
        | RpData
        | RrsigData
        | SrvData
        | SoaData
        | SshfpData
        | TlsaData
        | TxtData)[] | ZoneData[T][]

    The data for the given domain and record type, or null if no data is found