Figler.Container (figler v0.1.0-beta.1)

Copy Markdown View Source

Figma fig-kiwi container helpers.

Summary

Functions

Parses a fig-kiwi container and inflates only its data chunk.

Parses a fig-kiwi container and inflates its schema and data chunks.

Replaces the encoded message in a fig-kiwi container.

Functions

build(chunks, opts \\ [])

@spec build(
  [iodata()],
  keyword()
) :: binary()

data(binary)

@spec data(binary()) :: binary()

Parses a fig-kiwi container and inflates only its data chunk.

decode(binary)

@spec decode(binary()) :: %{
  version: non_neg_integer(),
  schema: KiwiCodec.Schema.t(),
  data: binary()
}

Parses a fig-kiwi container and inflates its schema and data chunks.

deflate(data)

@spec deflate(iodata()) :: binary()

See KiwiCodec.Container.deflate/1.

inflate(data)

@spec inflate(binary()) :: binary()

parse(binary)

@spec parse(binary()) :: %{
  magic: binary(),
  version: non_neg_integer(),
  chunks: [binary()]
}

replace_data(container, data)

@spec replace_data(binary(), iodata()) :: binary()

Replaces the encoded message in a fig-kiwi container.

The original schema chunk, container version, and any trailing chunks are preserved. The new data uses the same compression family as the original data chunk.