MOQX.Protocol.MOQTDraft14.Codec (moqx v0.10.0)

Copy Markdown View Source

Wire primitives and message codecs shared by draft-14 implementations.

Summary

Functions

authorization_token(token, token_type \\ 0)

@spec authorization_token(binary(), non_neg_integer()) :: binary()

Encodes a draft-14 AUTHORIZATION TOKEN using Alias Type USE_VALUE.

client_setup(params \\ %{})

@spec client_setup(map()) :: binary()

decode_control(buffer)

@spec decode_control(binary()) ::
  {:ok, [{non_neg_integer(), binary()}], binary()} | {:error, term()}

decode_publish_done(payload)

@spec decode_publish_done(binary()) :: {:ok, struct()} | {:error, term()}

decode_publish_namespace_cancel(payload)

@spec decode_publish_namespace_cancel(binary()) :: {:ok, struct()} | {:error, term()}

decode_publish_namespace_error(payload)

@spec decode_publish_namespace_error(binary()) :: {:ok, struct()} | {:error, term()}

decode_publish_namespace_ok(payload)

@spec decode_publish_namespace_ok(binary()) :: {:ok, struct()} | {:error, term()}

decode_server_setup(payload)

@spec decode_server_setup(binary()) :: {:ok, non_neg_integer()} | {:error, term()}

decode_subgroup_header(buffer)

@spec decode_subgroup_header(binary()) ::
  {:ok, struct(), binary()} | :more | {:error, term()}

decode_subgroup_object(buffer)

@spec decode_subgroup_object(binary()) ::
  {:ok, map(), binary()} | :more | {:error, term()}

decode_subgroup_object(header, current_object_id, buffer)

@spec decode_subgroup_object(struct(), non_neg_integer(), binary()) ::
  {:ok, struct(), binary()} | :more | {:error, term()}

decode_subscribe(payload)

@spec decode_subscribe(binary()) :: {:ok, struct()} | {:error, term()}

decode_subscribe_error(payload)

@spec decode_subscribe_error(binary()) :: {:ok, struct()} | {:error, term()}

decode_subscribe_ok(payload)

@spec decode_subscribe_ok(binary()) :: {:ok, map()} | {:error, term()}

decode_unsubscribe(payload)

@spec decode_unsubscribe(binary()) :: {:ok, struct()} | {:error, term()}

decode_varint(binary)

@spec decode_varint(binary()) :: {:ok, non_neg_integer(), binary()} | :more

encode(setup)

@spec encode(struct()) :: binary()

encode_subgroup(track_alias, object)

@spec encode_subgroup(non_neg_integer(), MOQX.Object.t()) :: binary()

encode_varint(value)

@spec encode_varint(non_neg_integer()) :: binary()

subscribe(request_id, track, options \\ [])

@spec subscribe(non_neg_integer(), MOQX.TrackRef.t(), keyword()) :: binary()

unsubscribe(request_id)

@spec unsubscribe(non_neg_integer()) :: binary()