riverside v1.0.1 Riverside.Behaviour behaviour

Link to this section Summary

Link to this section Types

Link to this type terminate_reason()
terminate_reason ::
  {:normal, :shutdown | :timeout} |
  {:remote, :closed} |
  {:remote, :cowboy_websocket.close_code, binary} |
  {:error, :badencoding | :badframe | :closed | :too_many_massages | :over_age | atom}

Link to this section Callbacks

Link to this callback __config__()
__config__() :: map
Link to this callback __handle_authentication__(req)
__handle_authentication__(req :: Riverside.AuthRequest.t) ::
  {:ok, Riverside.Session.user_id, any} |
  {:ok, Riverside.Session.user_id, Riverside.Session.session_id, any} |
  {:error, Riverside.AuthError.t}
Link to this callback __handle_data__(frame_type, message, session, state)
__handle_data__(frame_type :: Riverside.Codec.frame_type, message :: binary, session :: Riverside.Session.t, state :: any) ::
  {:ok, Riverside.Session.t} |
  {:error, :invalid_message | :unsupported}
Link to this callback handle_info(info, session, state)
handle_info(info :: any, session :: Riverside.Session.t, state :: any) :: {:ok, Riverside.Session.t, any}
Link to this callback handle_message(message, session, state)
handle_message(message :: any, session :: Riverside.Session.t, state :: any) :: {:ok, Riverside.Session.t, any}
Link to this callback init(session, state)
init(session :: Riverside.Session.t, state :: any) ::
  {:ok, Riverside.Session.t, any} |
  {:error, any}
Link to this callback terminate(reason, session, state)
terminate(reason :: terminate_reason, session :: Riverside.Session.t, state :: any) :: :ok