appendBinary

Available in a dev version: 0․11․0-grpc-186

How to configure

expect fun GrpcMetadata.appendBinary(key: String, value: ByteArray)(source)

Appends a binary metadata entry with the given key and value.

Binary keys must end with the "-bin" suffix according to gRPC specification. If the key already has values, the new value is added to the end of the list. Duplicate values for the same key are permitted.

Parameters

key

the name of the binary metadata entry (case-insensitive). Must contain only digits (0-9), lowercase letters (a-z), and special characters (-, _, .). Must end with -bin.

value

the binary value to add

Throws

if the key contains invalid characters or does not end with -bin


expect fun <T> GrpcMetadata.appendBinary(key: GrpcMetadataKey<T>, value: T)(source)

Appends a binary metadata entry with the given typed key and value.

Binary keys must end with the "-bin" suffix according to gRPC specification. The value is encoded using the marshaller associated with the key, which encodes values as raw bytes. If the key already has values, the new value is added to the end of the list. Duplicate values for the same key are permitted.

Parameters

key

the typed metadata key. The key name must end with -bin.

value

the value to add, which will be encoded using the key's marshaller

Type Parameters

T

the type of value associated with the key

Throws

if the key name contains invalid characters or does not end with -bin

actual fun GrpcMetadata.appendBinary(key: String, value: ByteArray)(source)

Appends a binary metadata entry with the given key and value.

Binary keys must end with the "-bin" suffix according to gRPC specification. If the key already has values, the new value is added to the end of the list. Duplicate values for the same key are permitted.

Parameters

key

the name of the binary metadata entry (case-insensitive). Must contain only digits (0-9), lowercase letters (a-z), and special characters (-, _, .). Must end with -bin.

value

the binary value to add

Throws

if the key contains invalid characters or does not end with -bin


actual fun <T> GrpcMetadata.appendBinary(key: GrpcMetadataKey<T>, value: T)(source)

Appends a binary metadata entry with the given typed key and value.

Binary keys must end with the "-bin" suffix according to gRPC specification. The value is encoded using the marshaller associated with the key, which encodes values as raw bytes. If the key already has values, the new value is added to the end of the list. Duplicate values for the same key are permitted.

Parameters

key

the typed metadata key. The key name must end with -bin.

value

the value to add, which will be encoded using the key's marshaller

Type Parameters

T

the type of value associated with the key

Throws

if the key name contains invalid characters or does not end with -bin

actual fun GrpcMetadata.appendBinary(key: String, value: ByteArray)(source)

Appends a binary metadata entry with the given key and value.

Binary keys must end with the "-bin" suffix according to gRPC specification. If the key already has values, the new value is added to the end of the list. Duplicate values for the same key are permitted.

Parameters

key

the name of the binary metadata entry (case-insensitive). Must contain only digits (0-9), lowercase letters (a-z), and special characters (-, _, .). Must end with -bin.

value

the binary value to add

Throws

if the key contains invalid characters or does not end with -bin


actual fun <T> GrpcMetadata.appendBinary(key: GrpcMetadataKey<T>, value: T)(source)

Appends a binary metadata entry with the given typed key and value.

Binary keys must end with the "-bin" suffix according to gRPC specification. The value is encoded using the marshaller associated with the key, which encodes values as raw bytes. If the key already has values, the new value is added to the end of the list. Duplicate values for the same key are permitted.

Parameters

key

the typed metadata key. The key name must end with -bin.

value

the value to add, which will be encoded using the key's marshaller

Type Parameters

T

the type of value associated with the key

Throws

if the key name contains invalid characters or does not end with -bin