gleam_gun/gun

Low level bindings to the gun API. You typically do not need to use this. Prefer the other modules in this library.

Types

pub type ConnectionPid
pub type Frame {
  Close
  Text(String)
  Binary(BitArray)
  TextBuilder(StringBuilder)
  BinaryBuilder(BitBuilder)
}

Constructors

  • Close
  • Text(String)
  • Binary(BitArray)
  • TextBuilder(StringBuilder)
  • BinaryBuilder(BitBuilder)
pub type StreamReference

Functions

pub fn await_up(pid: ConnectionPid) -> Result(Dynamic, Dynamic)
pub fn open(
  host: String,
  port: Int,
  opts_map: Dynamic,
) -> Result(ConnectionPid, Dynamic)
pub fn ws_send(pid: ConnectionPid, frame: Frame) -> Nil
pub fn ws_upgrade(
  pid: ConnectionPid,
  s: String,
  l: List(#(String, String)),
) -> StreamReference
Search Document