Raxol.Gateway.Route (RaxolGateway v0.2.0)

Copy Markdown View Source

Where a message comes from and goes back to.

A route carries the platform, the chat type, the chat id, and the user id. Its key/1 is the unified session key agent:main:{platform}:{chat_type}:{chat_id}, the stable identity a Raxol.Gateway.SessionRouter keys sessions by and that a future cross-platform handoff rebinds.

Summary

Functions

The unified session key for a route.

Build a route from a map or keyword list.

Types

t()

@type t() :: %Raxol.Gateway.Route{
  chat_id: String.t() | integer(),
  chat_type: atom(),
  platform: atom(),
  user_id: String.t() | integer() | nil
}

Functions

key(route)

@spec key(t()) :: String.t()

The unified session key for a route.

new(attrs)

@spec new(map() | keyword()) :: t()

Build a route from a map or keyword list.