protocolapp

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogonRequest           string = "logon"
	TextMessageSendRequest string = "send_text_message"
	OnChannelStatusEvent   string = "on_channel_status"
	OnErrorEvent           string = "on_error"
	OnStreamStartEvent     string = "on_stream_start"
	OnStreamStopEvent      string = "on_stream_stop"
	OnImageEvent           string = "on_image"
	OnTextMessageEvent     string = "on_text_message"
	OnLocationEvent        string = "on_location"
	OnResponseEvent        string = "xxx_on_response"
	OnImageDataEvent       string = "xxx_on_image_data"
	OnStreamDataEvent      string = "xxx_on_stream_data"
)

Commands we can zend to or receive from Zello

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command string `json:"command,omitempty"`
}

Command describes an generic command message for Zello Websoocket interface

type InternalTextMessageRequest added in v0.2.0

type InternalTextMessageRequest struct {
	For     string `json:"for,omitempty"`
	Message string `json:"message,omitempty"`
}

InternalTextMessageRequest inter-goroutine message

type Logon

type Logon struct {
	Command      string `json:"command,omitempty"`
	Seq          int    `json:"seq,omitempty"`
	AuthToken    string `json:"auth_token,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	Username     string `json:"username,omitempty"`
	Password     string `json:"password,omitempty"`
	Channel      string `json:"channel,omitempty"`
	ListenOnly   bool   `json:"listen_only,omitempty"`
}

Logon describes a logon message for Zello Websoocket interface

func NewLogon

func NewLogon() *Logon

NewLogon returns a template logon message

func (Logon) IncompleteCredentials

func (p Logon) IncompleteCredentials() bool

IncompleteCredentials checks completeness of logon details

type OnChannelStatus

type OnChannelStatus struct {
	Command            string `json:"command,omitempty"`
	Channel            string `json:"channel,omitempty"`
	Status             string `json:"status,omitempty"`
	UsersOnline        int    `json:"users_online,omitempty"`
	ImagesSupported    bool   `json:"images_supported,omitempty"`
	TextingSupported   bool   `json:"texting_supported,omitempty"`
	LocationsSupported bool   `json:"locations_supported,omitempty"`
	Error              string `json:"error,omitempty"`
	ErrorType          string `json:"error_type,omitempty"`
}

OnChannelStatus describes an on channel status message for Zello Websoocket interface

func NewOnChannelStatus

func NewOnChannelStatus() *OnChannelStatus

NewOnChannelStatus returns a new OnChannelStatus structure

type OnImage

type OnImage struct {
	Command   string `json:"command,omitempty"`
	Channel   string `json:"channel,omitempty"`
	From      string `json:"from,omitempty"`
	For       string `json:"for,omitempty"`
	MessageID int    `json:"message_id,omitempty"`
	Type      string `json:"type,omitempty"`
	Height    int    `json:"height,omitempty"`
	Width     int    `json:"width,omitempty"`
	Source    string `json:"source,omitempty"`
}

OnImage describes an on image message for Zello Websoocket interface

func NewOnImage

func NewOnImage() *OnImage

NewOnImage returns a new ZelloOnImage structure

type OnLocation

type OnLocation struct {
	Command          string  `json:"command,omitempty"`
	Channel          string  `json:"channel,omitempty"`
	From             string  `json:"from,omitempty"`
	For              string  `json:"for,omitempty"`
	MessageID        int     `json:"message_id,omitempty"`
	Latitude         float64 `json:"latitude,omitempty"`
	Longitude        float64 `json:"longitude,omitempty"`
	FormattedAddress string  `json:"formatted_address,omitempty"`
	Accuracy         float64 `json:"accuracy,omitempty"`
}

OnLocation describes an on location message for Zello Websoocket interface

func NewOnLocation

func NewOnLocation() *OnLocation

NewOnLocation returns a new ZelloOnLocation structure

type OnStreamStart

type OnStreamStart struct {
	Command        string `json:"command,omitempty"`
	Type           string `json:"type,omitempty"`
	Codec          string `json:"codec,omitempty"`
	PacketDuration int    `json:"packet_duration,omitempty"`
	StreamID       int    `json:"stream_id,omitempty"`
	Channel        string `json:"channel,omitempty"`
	From           string `json:"from,omitempty"`
	CodecHeader    string `json:"codec_header,omitempty"`
	For            string `json:"for,omitempty"`
}

OnStreamStart describes a stream start message for Zello Websoocket interface

func NewOnStreamStart

func NewOnStreamStart() *OnStreamStart

NewOnStreamStart returns a new ZelloOnStreamStart structure

type OnStreamStop

type OnStreamStop struct {
	Command  string `json:"command,omitempty"`
	StreamID int    `json:"stream_id,omitempty"`
}

OnStreamStop describes a stream stop message for Zello Websoocket interface

func NewOnStreamStop

func NewOnStreamStop() *OnStreamStop

NewOnStreamStop returns a new OnStreamStop structure

type OnTextMessage

type OnTextMessage struct {
	Command   string `json:"command,omitempty"`
	Channel   string `json:"channel,omitempty"`
	From      string `json:"from,omitempty"`
	For       string `json:"for,omitempty"`
	MessageID int    `json:"message_id,omitempty"`
	Text      string `json:"text,omitempty"`
}

OnTextMessage describes an on location message for Zello Websoocket interface

func NewOnTextMessage

func NewOnTextMessage() *OnTextMessage

NewOnTextMessage returns a new ZelloOnTextMessage structure

type Response

type Response struct {
	Seq          int    `json:"seq,omitempty"`
	Success      bool   `json:"success,omitempty"`
	Error        string `json:"error,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	StreamID     int    `json:"stream_id,omitempty"`
}

Response describes a response message for Zello Websoocket interface

func NewResponse

func NewResponse() *Response

NewResponse returns a template response message

type SendTextMessage added in v0.2.0

type SendTextMessage struct {
	Command string `json:"command,omitempty"`
	Seq     int    `json:"seq,omitempty"`
	Text    string `json:"text,omitempty"`
	For     string `json:"for,omitempty"`
}

SendTextMessage message for network worker

func NewSendTextMessage added in v0.2.0

func NewSendTextMessage() *SendTextMessage

NewSendTextMessage returns a new Zello SendTextMessage structure

type TextMessageRequest added in v0.2.0

type TextMessageRequest struct {
	For     string `json:"for,omitempty"`
	Message string `json:"message,omitempty"`
}

TextMessageRequest comes via a POST request

type TextMessageResponse added in v0.2.0

type TextMessageResponse struct {
	Error   string `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
}

TextMessageResponse to POST request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL