Skip to content
Strata is pre-1.0. APIs, protocol, and storage format may change.

strata_admin/status

Admin status JSON decoder used by the browser dashboard.

Status data for one document.

last_write_ms is an epoch time in milliseconds. A value of 0 means that no write time is available.

pub type AdminDocument {
AdminDocument(id: String, byte_size: Int, last_write_ms: Int, socket_count: Int, presences: List(AdminPresence))
}

Presence data for one session in the admin status.

pub type AdminPresence {
AdminPresence(session_id: String, name: String, color: String)
}

A server status snapshot and its generation time.

generated_at_ms is an epoch time in milliseconds.

pub type AdminStatus {
AdminStatus(generated_at_ms: Int, documents: List(AdminDocument))
}

Decode an admin status frame.

The function returns an error if the JSON is invalid, if a required field is invalid or missing, or if the protocol version or frame kind does not match.

pub fn decode(String) -> Result(AdminStatus, json.DecodeError)

Return a decoder for an admin status frame.

The decoder accepts the current protocol version and the admin_status frame kind.

pub fn decoder() -> decode.Decoder(AdminStatus)