Fake Mirrors
    Preparing search index...

    Class RedisProxyRepository

    Redis-based proxy repository implementation.

    Depends:

    import { DIContainer } from '@famir/common'
    import { PROXY_REPOSITORY, ProxyRepository, RedisProxyRepository } from '@famir/database'

    // Get container singleton
    const container = DIContainer.getInstance()

    // Register dependency in container
    RedisProxyRepository.register(container)

    // Resolve dependency from container
    const proxyRepository = container.resolve<ProxyRepository>(PROXY_REPOSITORY)

    // TODO more examples

    Implements

    • Creates a new proxy.

      The proxy will be created in a disabled state (isEnabled = false). Use enable to activate it for traffic routing.

      Parameters

      • campaignId: string

        The ID of the campaign to create the proxy in.

      • proxyId: string

        The new proxy ID to create.

      • url: string

        The upstream URL for the proxy.

      • lockSecret: string

        The campaign lock secret obtained from CampaignRepository.lock.

      Returns Promise<void>

      DatabaseError If the campaign does not exist.

      DatabaseError If the campaign is not locked.

      DatabaseError If the campaign lock secret does not match.

      DatabaseError If a proxy with the same ID already exists.

      DatabaseError If the proxy URL is already used.

      DatabaseError If the data validation fails.