Interface Option

interface Option {
    aliasName?: string;
    end?: string;
    env?: string;
    frame?: string;
    head?: any;
    metaData?: Record<string, string | ArrayBuffer>;
    namespace?: string;
    network?: string;
    options?: Record<string, string>;
    protocol?: string;
    protoInfo?: ProtoInfo;
    protoType?: string;
    protoVersion?: string;
    sendOnly?: boolean;
    serializationType?: 0 | 2;
    serverName?: string;
    serviceName?: string;
    setName?: string;
    target?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

aliasName?: string

trpc 特有插件别名

end?: string

end 帧尾。

env?: string

123 环境名,例如 formal、pre、test

frame?: string

frame 分帧头。

head?: any

head 包头。

metaData?: Record<string, string | ArrayBuffer>

请求头信息

namespace?: string

北极星环境类型(命名空间),例如 Production、Development

network?: string

网络类型 tcp or udp

options?: Record<string, string>

options 如 pb 序列化 jsonpb.emitDefaults 等。

protocol?: string

protocol 协议类型,同 protoType。

protoInfo?: ProtoInfo

protoInfo 流量协议映射数据,如流量是调用哪个 rpc 方法。

protoType?: string

protoType 协议类型,trpc/wns/qmf/sso 等,不填使用 protocol。

protoVersion?: string

protoVersion 协议中台的协议文件版本,默认最新版本。

sendOnly?: boolean

trpc 只发不收选项

serializationType?: 0 | 2

序列化类型。0-pb,2-json

serverName?: string

serverName 服务名,一般是 app.server。

serviceName?: string

被调服务名,用于北极星寻址

setName?: string

被调 set 名

target?: string

目标

timeoutMs?: number

请求超时,单位毫秒