- PoW (Hashcash) authentication - X.509 CA for phone number certificates (+0 XXX YYY ZZZ) - QUIC transport (hysteria quic-go fork) with ACME TLS - Custom append-only DB engine (from NikoGram) - Call signaling (dial/ring/accept/reject/end) - E2EE media relay (X25519 + ChaCha20-Poly1305) - Brutal congestion control (from hysteria) - Media datagram relay (Opus/VP9/H264/H265) - Graceful shutdown
54 lines
1,018 B
Go
54 lines
1,018 B
Go
package types
|
|
|
|
type RecType uint8
|
|
|
|
const (
|
|
RecIdentity RecType = 1
|
|
RecCallLog RecType = 2
|
|
RecIndex RecType = 6
|
|
)
|
|
|
|
type ErrorCode uint16
|
|
|
|
const (
|
|
ErrNone ErrorCode = 0x00
|
|
ErrInternal ErrorCode = 0x01
|
|
ErrInvalidRequest ErrorCode = 0x02
|
|
ErrPoWInvalid ErrorCode = 0x03
|
|
ErrPoWExpired ErrorCode = 0x04
|
|
ErrPoWDifficulty ErrorCode = 0x05
|
|
ErrNumberTaken ErrorCode = 0x06
|
|
ErrCooldown ErrorCode = 0x07
|
|
ErrNumberNotFound ErrorCode = 0x08
|
|
ErrCallNotFound ErrorCode = 0x09
|
|
ErrBusy ErrorCode = 0x0A
|
|
ErrSelfCall ErrorCode = 0x0B
|
|
ErrRateLimited ErrorCode = 0x0C
|
|
)
|
|
|
|
type CodecType uint8
|
|
|
|
const (
|
|
CodecOpus CodecType = 1
|
|
CodecVP9 CodecType = 2
|
|
CodecH264 CodecType = 3
|
|
CodecH265 CodecType = 4
|
|
)
|
|
|
|
type MediaFlags uint8
|
|
|
|
const (
|
|
MediaKeyframe MediaFlags = 1 << 0
|
|
MediaSilence MediaFlags = 1 << 1
|
|
)
|
|
|
|
const (
|
|
MaxFrameSize = 67_108_864
|
|
MaxRecordsPerFrame = 1_000_000
|
|
)
|
|
|
|
const (
|
|
StreamAuth byte = 0x01
|
|
StreamCall byte = 0x02
|
|
DgramMedia byte = 0x10
|
|
)
|