monflo/welcome_struct.go
2020-09-10 16:08:06 +08:00

58 lines
2.0 KiB
Go

package main
type Features struct {
MaxUserProfiles int `json:"max_user_profiles"`
MaxStreams int `json:"max_streams"`
MaxDevices int `json:"max_devices"`
MaxP2pResolution int `json:"max_p2p_resolution"`
MaxP2pFrames int `json:"max_p2p_frames"`
MaxRelayResolution int `json:"max_relay_resolution"`
MaxRelayFrames int `json:"max_relay_frames"`
Hevc bool `json:"hevc"`
SessionRecording bool `json:"session_recording"`
ManagementConsole bool `json:"management_console"`
ConnectAnywhere bool `json:"connect_anywhere"`
Support bool `json:"support"`
CommercialUse bool `json:"commercial_use"`
DeviceThumbnails bool `json:"device_thumbnails"`
FileTransfer bool `json:"file_transfer"`
}
type IPInfo struct {
PrivateAddr string `json:"private_addr"`
PublicAddr string `json:"public_addr"`
}
type StreamInfo struct {
Id string `json:"id,omitempty"`
Status string `json:"status,omitempty"` //ready busy
OwnerClient string `json:"owner_client,omitempty"`
Name string `json:"name,omitempty"`
PrivateAddr string `json:"private_addr,omitempty"`
PublicAddr string `json:"public_addr,omitempty"`
Key string `json:"key,omitempty"`
Bitrate int `json:"bitrate,omitempty"`
Formats []string `json:"formats,omitempty"` //h264 h265
}
type WelcomeData struct {
Client string `json:"client,omitempty"`
Features Features `json:"features,omitempty"`
Peers map[string]PeerInfo `json:"peers,omitempty"`
Subscription int `json:"subscription,omitempty"` //1=免费 2=专业 3=旗舰
Timestamp int64 `json:"timestamp,omitempty"` //1599118479
}
type WelcomeInfo struct {
MonfloResponse
Data WelcomeData `json:"data,omitempty"`
}
type PeerInfo struct {
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
LastIP IPInfo `json:"last_ip,omitempty"`
Streams map[string]StreamInfo `json:"streams"`
}