Class ContentRetrievalRuleBuilder

A builder to allow defining rules that will mock IPFS get requests.

Hierarchy

  • ContentRetrievalRuleBuilder

Constructors

Methods

  • Close the connection immediately after receiving the matching request, without sending any response.

    This method completes the rule definition, and returns a promise that resolves to a MockedIPFSEndpoint once the rule is active. This endpoint can be used to query the rule, and check what requests were received for this content.

    Returns Promise<MockedIPFSEndpoint>

  • Return a successful result, returning the the raw content provided here as if it came instantly from IPFS.

    This method completes the rule definition, and returns a promise that resolves to a MockedIPFSEndpoint once the rule is active. This endpoint can be used to query the rule, and check what requests were received for this content.

    Parameters

    • rawData: string

    Returns Promise<MockedIPFSEndpoint>

  • Timeout, accepting the request but never returning a response.

    This method completes the rule definition, and returns a promise that resolves to a MockedIPFSEndpoint once the rule is active. This endpoint can be used to query the rule, and check what requests were received for this content.

    Returns Promise<MockedIPFSEndpoint>

Generated using TypeDoc