Setu-TS
    Preparing search index...

    Interface ServiceInstance

    One reachable instance of a service.

    Providers normalize their backend's own shape into this — a Consul health entry, a Kubernetes EndpointSlice endpoint, a DNS SRV record, and a literal static entry all arrive here identically.

    0.2.0

    interface ServiceInstance {
        host: string;
        id: string;
        metadata?: Readonly<Record<string, string>>;
        port: number;
        secure?: boolean;
        serviceName: string;
        tags?: readonly string[];
        weight?: number;
    }
    Index
    host: string

    Hostname or IP literal. IPv6 literals arrive unbracketed.

    id: string

    Instance identity, unique within the service.

    Used as the ejection tracker's key, so it must be stable across resolves for ejection to survive a cache refresh.

    metadata?: Readonly<Record<string, string>>

    Free-form key/value metadata the backend carries.

    port: number

    TCP port.

    secure?: boolean

    Whether the instance speaks TLS, deciding the https scheme.

    serviceName: string

    The logical service this instance belongs to.

    tags?: readonly string[]

    Free-form labels the backend carries (Consul tags, for example).

    weight?: number

    Relative selection weight for the 'weighted-random' strategy.

    Absent means 1. A non-positive weight is never selected unless every instance is non-positive, in which case selection falls back to uniform.