You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zello-client/client/types.go

125 lines
3.3 KiB
Go

package client
type (
ZelloCodecHeader struct {
SampleRate uint16
FramesPerPaket int
FrameSize int
PacketDuration int
}
ZelloLocation struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
FormatedAddress string `json:"formatted_address"`
Accuracy float64 `json:"accuracy"`
}
ZelloCommand struct {
Command string `json:"command"`
Sequence int64 `json:"seq"`
}
ZelloResponse struct {
Sequence int64 `json:"seq"`
Command string `json:"command"`
}
ZelloResponsePacked struct {
ZelloResponse ZelloResponse
Raw map[string]interface{}
}
// Actual Cmds
ZelloLogonReq struct {
ZelloCommand
Username string `json:"username"`
Password string `json:"password"`
Channels []string `json:"channels,omitempty"`
AuthToken string `json:"auth_token,omitempty"`
ListenOnly bool `json:"listen_only,omitempty"`
PlatformType string `json:"platform_type,omitempty"`
PlatformName string `json:"platform_name,omitempty"`
}
ZelloLogonResp struct {
ZelloResponse
Success bool `json:"success"`
ErrorMsg string `json:"error,omitempty"`
}
// start_stream
ZelloStartStreamReq struct {
ZelloCommand
Channel string `json:"channel"`
Type string `json:"type"`
Codec string `json:"codec"`
CodecHeader string `json:"codec_header"`
PacketDuration float64 `json:"packet_duration"`
For string `json:"for,omitempty"`
}
ZelloStartStreamResp struct {
ZelloResponse
Success bool `json:"success"`
ErrorMsg string `json:"error,omitempty"`
StreamID int64 `json:"stream_id"`
}
// stop_stream
ZelloStopStreamReq struct {
ZelloCommand
Channel string `json:"channel"`
StreamID int64 `json:"stream_id"`
}
//Messages
ZelloSendTextMessage struct {
ZelloCommand
Channel string `json:"channel"`
Text string `json:"text"`
For string `json:"for,omitempty"`
}
ZelloSendLocation struct {
ZelloCommand
Channel string `json:"channel"`
ZelloLocation
For string `json:"for,omitempty"`
}
// Events
ZelloOnStreamStartEvent struct {
ZelloCommand
Channel string `json:"channel"`
StreamID int64 `json:"stream_id"`
Codec string `json:"codec"`
Type string `json:"type"`
From string `json:"from"`
CodecHeader string `json:"codec_header"`
PacketDuration float64 `json:"packet_duration"`
}
ZelloOnChannelStatusEvent struct {
ZelloCommand
Channel string `json:"channel"`
Status string `json:"status"`
UsersOnline float64 `json:"users_online"`
ImagesSupported bool `json:"images_supported"`
TextingSupported bool `json:"texting_supported"`
LocationsSupported bool `json:"locations_supported"`
}
ZelloOnStreamStopEvent struct {
ZelloCommand
StreamID int64 `json:"stream_id"`
}
ZelloOnTextMessageEvent struct {
ZelloCommand
Channel string `json:"channel"`
From string `json:"from"`
For string `json:"for,omitempty"`
MessageID int64 `json:"message_id"`
Text string `json:"text"`
}
ZelloOnLocationEvent struct {
ZelloCommand
Channel string `json:"channel"`
From string `json:"from"`
For string `json:"for,omitempty"`
MessageID int64 `json:"message_id"`
ZelloLocation
}
)