Blur v0.2.1-beta1 Blur.Channel View Source

Channel module

Link to this section Summary

Functions

Add user to channel

Get aliases for a channel

Returns a specification to start this module under a supervisor.

Get commands for a channel

Get config for a channel

Handle channel info

Handle channel users

Remove user from the channel

Start channel store

Get users in a channel

Link to this section Functions

Specs

add_user(channel :: binary(), user :: binary()) :: :ok

Add user to channel

Examples

iex> Blur.Channel.add_user "#rockerboo", "rockerBOO"
:ok

Specs

aliases(channel :: binary()) :: list()

Get aliases for a channel

Examples

iex> Blur.Channel.aliases "#rockerboo"
%{}

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

commands(channel :: binary()) :: list()

Get commands for a channel

Examples

iex> Blur.Channel.commands "#rockerboo"
%{}

Specs

config?(channel :: binary()) :: nil | map()

Get config for a channel

Examples

iex> Blur.Channel.config? "#rockerboo"
%{}
Link to this function

handle_call(msg, from, state)

View Source

Specs

handle_call(:aliases, pid(), %Blur.Channel.State{
  channel: term(),
  client: term(),
  config?: term(),
  users: term()
}) ::
  {:reply, map(),
   %Blur.Channel.State{
     channel: term(),
     client: term(),
     config?: term(),
     users: term()
   }}
handle_call(:commands, pid(), %Blur.Channel.State{
  channel: term(),
  client: term(),
  config?: term(),
  users: term()
}) ::
  {:reply, map(),
   %Blur.Channel.State{
     channel: term(),
     client: term(),
     config?: term(),
     users: term()
   }}
handle_call(:config?, pid(), %Blur.Channel.State{
  channel: term(),
  client: term(),
  config?: term(),
  users: term()
}) ::
  {:reply, nil | map(),
   %Blur.Channel.State{
     channel: term(),
     client: term(),
     config?: term(),
     users: term()
   }}
handle_call(:users, pid(), %Blur.Channel.State{
  channel: term(),
  client: term(),
  config?: term(),
  users: term()
}) ::
  {:reply, list(),
   %Blur.Channel.State{
     channel: term(),
     client: term(),
     config?: term(),
     users: term()
   }}

Handle channel info

Specs

handle_cast({:add_user, user :: binary()}, %Blur.Channel.State{
  channel: term(),
  client: term(),
  config?: term(),
  users: term()
}) ::
  {:reply, list(),
   %Blur.Channel.State{
     channel: term(),
     client: term(),
     config?: term(),
     users: term()
   }}

Handle channel users

Link to this function

remove_user(channel, user)

View Source

Specs

remove_user(channel :: binary(), user :: binary()) :: :ok

Remove user from the channel

Examples

iex> Blur.Channel.remove_user "#rockerboo", "rockerBOO"
:ok
Link to this function

start_link(client, channel)

View Source

Specs

start_link(client :: pid(), channel :: binary()) :: GenServer.on_start()

Start channel store

Specs

to_atom(channel :: binary()) :: atom()

Specs

users(channel :: binary()) :: :ok

Get users in a channel

Examples

iex> Blur.Channel.users "#rockerboo"
["rockerBOO"]