postgleam/codec/registry

Types

A registry mapping OID -> Codec

pub type Registry =
  dict.Dict(Int, codec.Codec)

Values

pub fn build(
  matchers: List(codec.CodecMatcher),
) -> dict.Dict(Int, codec.Codec)

Build a registry from a list of matchers and known OIDs

pub fn find_by_send(
  matchers: List(codec.CodecMatcher),
  send_fn: String,
) -> Result(codec.CodecMatcher, Nil)

Find a codec matcher by send function name

pub fn lookup(
  registry: dict.Dict(Int, codec.Codec),
  oid: Int,
) -> Result(codec.Codec, String)

Look up a codec by OID

pub fn register(
  registry: dict.Dict(Int, codec.Codec),
  oid: Int,
  matcher: codec.CodecMatcher,
) -> dict.Dict(Int, codec.Codec)

Register a single OID with a specific matcher’s build function

Search Document