class

Wgctl::Models::RuntimePeer

Inherits JSON::Serializable < Reference < Object

Constructors

new(public_key : String, preshared_key : String | Nil = nil, endpoint : String | Nil = nil, allowed_ips : Array(String) = [] of String, latest_handshake_epoch : Int64 = 0_i64, transfer_rx : UInt64 = 0_u64, transfer_tx : UInt64 = 0_u64, persistent_keepalive : Int32 | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

format_bytes(bytes : UInt64) : String
Source

Instance methods

allowed_ips
Source
allowed_ips=(allowed_ips : Array(String))
Source
endpoint
Source
endpoint=(endpoint : String | Nil)
Source
formatted_handshake(now : Time = Time.utc) : String
Source
formatted_rx
Source
formatted_tx
Source
latest_handshake_epoch
Source
latest_handshake_epoch=(latest_handshake_epoch : Int64)
Source
latest_handshake_time
Source
online?(threshold_seconds : Int32 = 180) : Bool

A peer is considered online if it had a handshake within the last 3 minutes (180s)

Source
persistent_keepalive
Source
persistent_keepalive=(persistent_keepalive : Int32 | Nil)
Source
preshared_key
Source
preshared_key=(preshared_key : String | Nil)
Source
public_key
Source
public_key=(public_key : String)
Source
transfer_rx
Source
transfer_rx=(transfer_rx : UInt64)
Source
transfer_tx
Source
transfer_tx=(transfer_tx : UInt64)
Source