Documentation
¶
Index ¶
- Constants
- func AppAPI(path string) string
- func ClientAPI(path string) string
- func CommandsAPI(path string) string
- func DeviceAPI(path string) string
- type AnswerMessage
- type Auth2faResponse
- type AuthConfig
- type AuthTokenResponse
- type CameraData
- type CameraKind
- type Client
- func (c *Client) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error
- func (c *Client) GetMedias() []*core.Media
- func (c *Client) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)
- func (c *Client) MarshalJSON() ([]byte, error)
- func (c *Client) Start() error
- func (c *Client) Stop() error
- type CloseRequest
- type EmailAuth
- type IceCandidateMessage
- type NotificationMessage
- type PongMessage
- type RefreshTokenAuth
- type RingApi
- type RingDeviceType
- type RingDevicesResponse
- type SessionBody
- type SessionMessage
- type SessionResponse
- type SnapshotProducer
- type SocketTicketResponse
- type StreamInfoMessage
- type WSClient
- type WSMessage
Constants ¶
View Source
const ( CloseReasonNormalClose = 0 CloseReasonAuthenticationFailed = 5 CloseReasonTimeout = 6 )
Variables ¶
This section is empty.
Functions ¶
func CommandsAPI ¶
Types ¶
type AnswerMessage ¶
type AnswerMessage struct {
Method string `json:"method"` // "sdp"
Body struct {
SessionBody
SDP string `json:"sdp"`
Type string `json:"type"` // "answer"
} `json:"body"`
}
type Auth2faResponse ¶
type AuthConfig ¶
type AuthTokenResponse ¶
type CameraData ¶
type CameraKind ¶
type CameraKind string
const ( Doorbot CameraKind = "doorbot" Doorbell CameraKind = "doorbell" DoorbellV3 CameraKind = "doorbell_v3" DoorbellV4 CameraKind = "doorbell_v4" DoorbellV5 CameraKind = "doorbell_v5" DoorbellOyster CameraKind = "doorbell_oyster" DoorbellPortal CameraKind = "doorbell_portal" DoorbellScallop CameraKind = "doorbell_scallop" DoorbellScallopLite CameraKind = "doorbell_scallop_lite" DoorbellGraham CameraKind = "doorbell_graham_cracker" LpdV1 CameraKind = "lpd_v1" LpdV2 CameraKind = "lpd_v2" LpdV4 CameraKind = "lpd_v4" JboxV1 CameraKind = "jbox_v1" StickupCam CameraKind = "stickup_cam" StickupCamV3 CameraKind = "stickup_cam_v3" StickupCamElite CameraKind = "stickup_cam_elite" StickupCamLongfin CameraKind = "stickup_cam_longfin" StickupCamLunar CameraKind = "stickup_cam_lunar" SpotlightV2 CameraKind = "spotlightw_v2" HpCamV1 CameraKind = "hp_cam_v1" HpCamV2 CameraKind = "hp_cam_v2" StickupCamV4 CameraKind = "stickup_cam_v4" FloodlightV1 CameraKind = "floodlight_v1" FloodlightV2 CameraKind = "floodlight_v2" FloodlightPro CameraKind = "floodlight_pro" CocoaCamera CameraKind = "cocoa_camera" CocoaDoorbell CameraKind = "cocoa_doorbell" CocoaFloodlight CameraKind = "cocoa_floodlight" CocoaSpotlight CameraKind = "cocoa_spotlight" StickupCamMini CameraKind = "stickup_cam_mini" OnvifCamera CameraKind = "onvif_camera" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) MarshalJSON ¶
type CloseRequest ¶ added in v1.9.11
type CloseRequest struct {
Method string `json:"method"` // "close"
Body struct {
SessionBody
Reason struct {
Code int `json:"code"`
Text string `json:"text"`
} `json:"reason"`
} `json:"body"`
}
type IceCandidateMessage ¶
type IceCandidateMessage struct {
Method string `json:"method"` // "ice"
Body struct {
SessionBody
Ice string `json:"ice"`
MLineIndex int `json:"mlineindex"`
} `json:"body"`
}
type NotificationMessage ¶
type NotificationMessage struct {
Method string `json:"method"` // "notification"
Body struct {
SessionBody
IsOK bool `json:"is_ok"`
Text string `json:"text"`
} `json:"body"`
}
type PongMessage ¶
type PongMessage struct {
Method string `json:"method"` // "pong"
Body SessionBody `json:"body"`
}
type RefreshTokenAuth ¶
type RefreshTokenAuth struct {
RefreshToken string
}
type RingApi ¶ added in v1.9.11
type RingApi struct {
Using2FA bool
PromptFor2FA string
RefreshToken string
// contains filtered or unexported fields
}
func NewRestClient ¶ added in v1.9.11
func (*RingApi) FetchRingDevices ¶ added in v1.9.11
func (c *RingApi) FetchRingDevices() (*RingDevicesResponse, error)
func (*RingApi) GetAuth ¶ added in v1.9.11
func (c *RingApi) GetAuth(twoFactorAuthCode string) (*AuthTokenResponse, error)
func (*RingApi) GetSocketTicket ¶ added in v1.9.11
func (c *RingApi) GetSocketTicket() (*SocketTicketResponse, error)
type RingDeviceType ¶
type RingDeviceType string
const ( IntercomHandsetAudio RingDeviceType = "intercom_handset_audio" OnvifCameraType RingDeviceType = "onvif_camera" )
type RingDevicesResponse ¶
type RingDevicesResponse struct {
Doorbots []CameraData `json:"doorbots"`
AuthorizedDoorbots []CameraData `json:"authorized_doorbots"`
StickupCams []CameraData `json:"stickup_cams"`
AllCameras []CameraData `json:"all_cameras"`
Chimes []CameraData `json:"chimes"`
Other []map[string]interface{} `json:"other"`
}
type SessionBody ¶
type SessionMessage ¶
type SessionMessage struct {
Method string `json:"method"` // "session_created" or "session_started"
Body SessionBody `json:"body"`
}
type SessionResponse ¶ added in v1.9.11
type SnapshotProducer ¶
type SnapshotProducer struct {
core.Connection
// contains filtered or unexported fields
}
func NewSnapshotProducer ¶
func NewSnapshotProducer(client *RingApi, cameraID int) *SnapshotProducer
func (*SnapshotProducer) Start ¶
func (p *SnapshotProducer) Start() error
func (*SnapshotProducer) Stop ¶
func (p *SnapshotProducer) Stop() error
type SocketTicketResponse ¶
type StreamInfoMessage ¶
type StreamInfoMessage struct {
Method string `json:"method"` // "stream_info"
Body struct {
SessionBody
Transcoding bool `json:"transcoding"`
TranscodingReason string `json:"transcoding_reason"`
} `json:"body"`
}
type WSClient ¶ added in v1.9.11
type WSClient struct {
// contains filtered or unexported fields
}
func StartWebsocket ¶ added in v1.9.11
Click to show internal directories.
Click to hide internal directories.