Class PinRemoteLsRuleBuilder

A builder to allow defining rules that will mock IPFS pin remote services ls requests.

Hierarchy

  • PinRemoteLsRuleBuilder

Constructors

  • This builder should not be constructed directly. Call mockNode.forPinRemoteLs() instead.

    Parameters

    • addRuleCallback: ((data: RequestRuleData) => Promise<void>)
        • (data: RequestRuleData): Promise<void>
        • Parameters

          • data: RequestRuleData

          Returns Promise<void>

    Returns PinRemoteLsRuleBuilder

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 once the rule is active.

    Returns Promise<void>

  • Return a successful result, returning the given fixed list of remote pinning services. The parameter should be an array of { service, endpoint, stat? } objects, where service is the name of the service, endpoint is the URL of the remote service, and stat is the status and optional pin count object.

    When a request includes the stat=true querystring parameter return the stat object, otherwise exclude it. Note: if the mock data did not include a stat object, the service is set to have an invalid status.

    This method completes the rule definition, and returns a promise that resolves once the rule is active.

    Parameters

    • values: (RemotePinServiceWithStat | RemotePinService)[]

    Returns Promise<void>

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

    This method completes the rule definition, and returns a promise that resolves once the rule is active.

    Returns Promise<void>

Generated using TypeDoc