connect_kit library

Classes

Any
Any contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.
Api
Api is a light-weight descriptor for an API Interface.
BoolValue
Wrapper message for bool.
BytesValue
Wrapper message for bytes.
ConnectClient
Base class for Connect RPC clients: the shared Transport and the per-call deadline defaults. A deadline is a per-call TimeoutSignal rather than a stub option, and it bounds the whole logical call, retries included; the server still enforces its own per-attempt deadline.
ConnectMetadataMiddleware
Adds a fixed set of metadata entries (headers) to every call.
ConnectMiddleware
A middleware over a Connect call, in the shape HTTP middleware usually takes: one method wraps the whole request and response flow. The generic call satisfies connectrpc's Interceptor, so an instance goes straight into a transport's interceptors: list, where the first entry is the outermost layer.
ConnectRetryMiddleware
The one transient-retry layer for the Connect transport: retries transient unary calls with full-jitter exponential backoff (RetryBackoff), honoring server pushback (grpc-retry-pushback-ms) and a total time budget. Retries elsewhere nest and amplify; do not add them.
ConnectTransportConfig
Keep-alive and idle settings for the HTTP/2 client behind the Connect transports.
DoubleValue
Wrapper message for double.
Empty
A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:
Enum
Enum type definition.
EnumValue
Enum value definition.
Field
A single field of a message type.
Field_Cardinality
Whether a field is optional, required, or repeated.
Field_Kind
Basic field types.
FieldMask
FieldMask represents a set of symbolic field paths, for example:
FloatValue
Wrapper message for float.
Int32Value
Wrapper message for int32.
Int64Value
Wrapper message for int64.
ListValue
ListValue is a wrapper around a repeated field of values.
Method
Method represents a method of an API interface.
Mixin
Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but documentation and options are inherited as follows:
NullValue
NullValue is a singleton enumeration to represent the null value for the Value type union.
Option
A protocol buffer option, which can be attached to a message, field, enumeration, etc.
RetryBackoff
Transport-agnostic retry backoff policy for unstable (mobile/cellular) networks.
RootCertificates
The root CAs the pinned SecurityContext trusts. This set replaces the platform trust store, so it has to cover every CA a backend can serve: Let's Encrypt ISRG Root X1 for RSA chains and X2 for ECDSA chains, and Google Trust Services GTS Root R1 to R4 for hosts on Google infrastructure.
RpcHttpClientHandle
Owns the platform HTTP client shared by the transports: create one, pass it to every createConnectTransport, close it on teardown. One handle lets every service multiplex the per-origin HTTP/2 connections.
SourceContext
SourceContext represents information about the source of a protobuf element, like the file in which it is defined.
StringValue
Wrapper message for string.
Struct
Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.
Syntax
The syntax in which a protocol buffer element is defined.
Timestamp
A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.
Type
A protocol buffer message type.
UInt32Value
Wrapper message for uint32.
UInt64Value
Wrapper message for uint64.
Value
Value represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error.

Enums

Value_Kind

Extensions

BoolValueX on BoolValue
A wrapper message as a nullable Dart value: unset on the wire reads as null.
BytesValueX on BytesValue
A wrapper message as nullable bytes: unset on the wire reads as null.
ConnectExceptionX on ConnectException
Maps an RPC failure to a message for the user.
DoubleValueX on DoubleValue
A wrapper message as a nullable Dart value: unset on the wire reads as null.
DurationRpc1X on Duration
A Dart Duration as the wire message, whole seconds only.
DurationRpcX on Duration
Seconds, the only field the wire Duration carries here.
GeneratedMessageGenericExtensions on T
Extensions on GeneratedMessages.
GuidNullX on Guid?
Whether a Guid carries no id: null, empty, or the nil UUID.
GuidX on Guid
Sentinels for a Guid.
Int32ValueX on Int32Value
A wrapper message as a nullable Dart value: unset on the wire reads as null.
RpcBoolX on bool?
A nullable Dart value as its wrapper message: null becomes the unset default.
RpcBytesX on Uint8List?
Nullable bytes as their wrapper message: null becomes the unset default.
RpcDoubleX on double?
A nullable Dart value as its wrapper message: null becomes the unset default.
RpcIntX on int?
A nullable Dart value as its wrapper message: null becomes the unset default.

Properties

anyDescriptor Uint8List
Descriptor for Any. Decode as a google.protobuf.DescriptorProto.
final
apiDescriptor Uint8List
Descriptor for Api. Decode as a google.protobuf.DescriptorProto.
final
boolValueDescriptor Uint8List
Descriptor for BoolValue. Decode as a google.protobuf.DescriptorProto.
final
bytesValueDescriptor Uint8List
Descriptor for BytesValue. Decode as a google.protobuf.DescriptorProto.
final
defaultAcceptCompressions List<Compression>
The compressions the client advertises and can decode in responses (accept-encoding and connect-accept-encoding), so the server may gzip what it sends back. Compressing the request is a separate opt-in through createConnectTransport.
final
doubleValueDescriptor Uint8List
Descriptor for DoubleValue. Decode as a google.protobuf.DescriptorProto.
final
durationDescriptor Uint8List
Descriptor for Duration. Decode as a google.protobuf.DescriptorProto.
final
emptyDescriptor Uint8List
Descriptor for Empty. Decode as a google.protobuf.DescriptorProto.
final
fieldMaskDescriptor Uint8List
Descriptor for FieldMask. Decode as a google.protobuf.DescriptorProto.
final
floatValueDescriptor Uint8List
Descriptor for FloatValue. Decode as a google.protobuf.DescriptorProto.
final
int32ValueDescriptor Uint8List
Descriptor for Int32Value. Decode as a google.protobuf.DescriptorProto.
final
int64ValueDescriptor Uint8List
Descriptor for Int64Value. Decode as a google.protobuf.DescriptorProto.
final
listValueDescriptor Uint8List
Descriptor for ListValue. Decode as a google.protobuf.DescriptorProto.
final
methodDescriptor Uint8List
Descriptor for Method. Decode as a google.protobuf.DescriptorProto.
final
mixinDescriptor Uint8List
Descriptor for Mixin. Decode as a google.protobuf.DescriptorProto.
final
nullValueDescriptor Uint8List
Descriptor for NullValue. Decode as a google.protobuf.EnumDescriptorProto.
final
sourceContextDescriptor Uint8List
Descriptor for SourceContext. Decode as a google.protobuf.DescriptorProto.
final
stringValueDescriptor Uint8List
Descriptor for StringValue. Decode as a google.protobuf.DescriptorProto.
final
structDescriptor Uint8List
Descriptor for Struct. Decode as a google.protobuf.DescriptorProto.
final
timestampDescriptor Uint8List
Descriptor for Timestamp. Decode as a google.protobuf.DescriptorProto.
final
uInt32ValueDescriptor Uint8List
Descriptor for UInt32Value. Decode as a google.protobuf.DescriptorProto.
final
uInt64ValueDescriptor Uint8List
Descriptor for UInt64Value. Decode as a google.protobuf.DescriptorProto.
final
valueDescriptor Uint8List
Descriptor for Value. Decode as a google.protobuf.DescriptorProto.
final

Functions

createConnectTransport(Uri address, {required RpcHttpClientHandle httpClient, List<Interceptor> interceptors = const [], Compression? sendCompression, List<Compression>? acceptCompressions}) → Transport
Creates a Connect-protocol Transport for address, with binary protobuf on every platform; swapping the codec makes it JSON.
createRpcHttpClient({ConnectTransportConfig config = .defaultConfig}) RpcHttpClientHandle
The native HTTP client: HTTP/2 with prior-knowledge h2c for http, pinned TLS for https, and the keep-alive and idle behaviour from config.
rpcSecurityContext() SecurityContext
A SecurityContext without the system roots, carrying RootCertificates.trustedRoots instead. The pinned set replaces the platform trust store, so it has to cover every CA the backends can serve, fallback hosts included.
securityContextForAddress(Uri address) SecurityContext?
TLS by URI scheme: https and wss get the context pinned to RootCertificates.trustedRoots, http and ws get plain h2c. Public and pure, so the trust decision is testable without a real client. connectrpc branches on the same scheme and consults the SecurityContext only for TLS origins, which is why the shared client below can always carry the pinned context.

Typedefs

ConnectMiddlewareHandler = Future<void> Function(String path, Map<String, String> metadata)
Invokes the call at path with metadata as its headers; it completes when the whole call does, a streamed response included.
Guid = String
A UUID carried as its string form.
RetryNotifier = void Function(Object error, int attempt, Duration delay)
Called before a retry sleeps: the error behind the failed attempt and the delay chosen.