Documentation
¶
Index ¶
- Constants
- func IsAuthenticationError(err error) bool
- func IsBadRequestError(err error) bool
- func IsClosedError(err error) bool
- func IsConnectionError(err error) bool
- func IsHTTPError(err error) bool
- func IsHTTPStatusCode(err error, code int) bool
- func IsInternalServerError(err error) bool
- func IsNetworkError(err error) bool
- func IsNotFoundError(err error) bool
- func IsRateLimitError(err error) bool
- func IsRequires2FAError(err error) bool
- func IsTokenError(err error) bool
- func IsUnauthorizedError(err error) bool
- type AuthResponse
- type AuthenticationError
- type BadRequestError
- type Chime
- type ClosedError
- type ConnectionError
- type Device
- type DeviceFamily
- type DeviceHealth
- type DevicesResponse
- type Doorbell
- type Event
- type EventCallback
- type EventKind
- type HTTPError
- type InternalServerError
- type NetworkError
- type NotFoundError
- type Other
- type RTCStream
- type RTCStreamConfig
- type RateLimitError
- type Recording
- type RecordingHistoryResponse
- type Requires2FAError
- type SoundKind
- type StickUpCam
- type TokenError
- type UnauthorizedError
- type VideoStream
Constants ¶
const ( // Ring API base URIs RingAPIBaseURI = "https://api.ring.com" RingOAuthURI = "https://oauth.ring.com/oauth/token" // Ring API endpoints RingDevicesEndpoint = "/clients_api/ring_devices" RingDingsActiveEndpoint = "/clients_api/dings/active" RingDingsHistoryEndpoint = "/clients_api/dings/history" RingRecordingEndpoint = "/clients_api/dings/{id}/recording" // RTC Streaming endpoints RingAppAPIURI = "https://prd-api-us.prd.rings.solutions" RingRTCStreamingTicketEndpoint = "/api/v1/clap/ticket/request/signalsocket" RingRTCStreamingWebSocketEndpoint = "" /* 140-byte string literal not displayed */ // Default user agent DefaultUserAgent = "android:com.ringapp" // OAuth constants RingClientID = "ring_official_android" RingScope = "client" )
Variables ¶
This section is empty.
Functions ¶
func IsAuthenticationError ¶
IsAuthenticationError checks if an error is an AuthenticationError
func IsBadRequestError ¶
IsBadRequestError checks if an error is a BadRequestError
func IsClosedError ¶
IsClosedError checks if an error is a ClosedError
func IsConnectionError ¶
IsConnectionError checks if an error is a ConnectionError
func IsHTTPStatusCode ¶
IsHTTPStatusCode checks if an error is an HTTPError with a specific status code
func IsInternalServerError ¶
IsInternalServerError checks if an error is a InternalServerError
func IsNetworkError ¶
IsNetworkError checks if an error is a NetworkError
func IsNotFoundError ¶
IsNotFoundError checks if an error is a NotFoundError
func IsRateLimitError ¶
func IsRequires2FAError ¶
IsRequires2FAError checks if an error is a Requires2FAError
func IsTokenError ¶
IsTokenError checks if an error is a TokenError
func IsUnauthorizedError ¶
IsUnauthorizedError checks if an error is a UnauthorizedError
Types ¶
type AuthResponse ¶
AuthResponse represents an authentication response
type AuthenticationError ¶
AuthenticationError represents an authentication failure
func NewAuthenticationError ¶
func NewAuthenticationError(message string, status int) *AuthenticationError
NewAuthenticationError creates a new AuthenticationError
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
type BadRequestError ¶
BadRequestError represents a bad request error
func NewBadRequestError ¶
func NewBadRequestError(message string, err error) *BadRequestError
NewBadRequestError creates a new BadRequestError
func (*BadRequestError) Error ¶
func (e *BadRequestError) Error() string
func (*BadRequestError) Unwrap ¶
func (e *BadRequestError) Unwrap() error
type Chime ¶
type Chime struct {
ID string `json:"id"`
Name string `json:"name"`
Family string `json:"family"`
Address string `json:"address"`
Timezone string `json:"timezone"`
WifiName string `json:"wifi_name"`
WifiSignalStrength int `json:"wifi_signal_strength"`
Volume int `json:"volume"`
Health *DeviceHealth `json:"health,omitempty"`
}
Chime represents a Ring chime device
func (*Chime) GetAddress ¶
func (*Chime) GetFamily ¶
func (c *Chime) GetFamily() DeviceFamily
func (*Chime) GetTimezone ¶
type ClosedError ¶
type ClosedError struct {
Message string
}
ClosedError represents an error when trying to use a closed connection
func NewClosedError ¶
func NewClosedError(message string) *ClosedError
NewClosedError creates a new ClosedError
func (*ClosedError) Error ¶
func (e *ClosedError) Error() string
type ConnectionError ¶
ConnectionError represents a connection failure
func NewConnectionError ¶
func NewConnectionError(message string, err error) *ConnectionError
NewConnectionError creates a new ConnectionError
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
func (*ConnectionError) Unwrap ¶
func (e *ConnectionError) Unwrap() error
type Device ¶
type Device interface {
GetID() string
GetName() string
GetFamily() DeviceFamily
GetAddress() string
GetTimezone() string
}
Device represents a generic Ring device
type DeviceFamily ¶
type DeviceFamily string
DeviceFamily represents the family/type of a Ring device
const ( DeviceFamilyDoorbell DeviceFamily = "doorbots" DeviceFamilyChime DeviceFamily = "chimes" DeviceFamilyStickUpCam DeviceFamily = "stickup_cams" DeviceFamilyOther DeviceFamily = "other" )
type DeviceHealth ¶
type DeviceHealth struct {
BatteryLevel *int `json:"battery_level,omitempty"`
BatteryStatus *string `json:"battery_status,omitempty"`
SignalStrength *int `json:"signal_strength,omitempty"`
FirmwareVersion *string `json:"firmware_version,omitempty"`
LastUpdate *string `json:"last_update,omitempty"`
}
DeviceHealth represents health information for a device
type DevicesResponse ¶
type DevicesResponse struct {
Doorbells []*Doorbell `json:"doorbots"`
Chimes []*Chime `json:"chimes"`
StickUpCams []*StickUpCam `json:"stickup_cams"`
Other []*Other `json:"other"`
}
DevicesResponse represents the response from listing devices
func (*DevicesResponse) GetAllDevices ¶
func (d *DevicesResponse) GetAllDevices() []Device
GetAllDevices returns all devices as a slice of Device interfaces
type Doorbell ¶
type Doorbell struct {
ID string `json:"id"`
Name string `json:"name"`
Family string `json:"family"`
Address string `json:"address"`
Timezone string `json:"timezone"`
WifiName string `json:"wifi_name"`
WifiSignalStrength int `json:"wifi_signal_strength"`
Volume int `json:"volume"`
HasLight bool `json:"has_light"`
LightBrightness *int `json:"light_brightness,omitempty"`
MotionDetectionEnabled bool `json:"motion_detection_enabled"`
Health *DeviceHealth `json:"health,omitempty"`
}
Doorbell represents a Ring doorbell device
func (*Doorbell) GetAddress ¶
func (*Doorbell) GetFamily ¶
func (d *Doorbell) GetFamily() DeviceFamily
func (*Doorbell) GetTimezone ¶
type Event ¶
type Event struct {
Kind EventKind `json:"kind"` // "motion", "ding", "on_demand"
DeviceID int64 `json:"device_id"`
Timestamp string `json:"timestamp"`
Data map[string]interface{} `json:"data,omitempty"`
}
Event represents a Ring event
type EventCallback ¶
EventCallback is a function type for handling events
type HTTPError ¶
HTTPError represents an HTTP-level error with status code
func NewHTTPError ¶
NewHTTPError creates a new HTTPError from an HTTP response
type InternalServerError ¶
InternalServerError represents an internal server error
func NewInternalServerError ¶
func NewInternalServerError(message string, err error) *InternalServerError
NewInternalServerError creates a new InternalServerError
func (*InternalServerError) Error ¶
func (e *InternalServerError) Error() string
func (*InternalServerError) Unwrap ¶
func (e *InternalServerError) Unwrap() error
type NetworkError ¶
NetworkError represents a network-level error
func NewNetworkError ¶
func NewNetworkError(message string, err error) *NetworkError
NewNetworkError creates a new NetworkError
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error
type NotFoundError ¶
NotFoundError represents a not found error
func NewNotFoundError ¶
func NewNotFoundError(message string, err error) *NotFoundError
NewNotFoundError creates a new NotFoundError
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
type Other ¶
type Other struct {
ID string `json:"id"`
Name string `json:"name"`
Family string `json:"family"`
Address string `json:"address"`
Timezone string `json:"timezone"`
Kind string `json:"kind"`
Health *DeviceHealth `json:"health,omitempty"`
}
Other represents a Ring "other" device (e.g., Intercom)
func (*Other) GetAddress ¶
func (*Other) GetFamily ¶
func (o *Other) GetFamily() DeviceFamily
func (*Other) GetTimezone ¶
type RTCStream ¶
type RTCStream struct {
StreamID string
DeviceID int64
SDPOffer string
SDPAnswer string
ICECandidates []string
StreamURL string
}
RTCStream represents a WebRTC stream for live video
type RTCStreamConfig ¶
type RTCStreamConfig struct {
DeviceID int64
}
RTCStreamConfig represents configuration for starting an RTC stream
type RateLimitError ¶
type RateLimitError struct {
Message string
}
func NewRateLimitError ¶
func NewRateLimitError(message string) *RateLimitError
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
type Recording ¶
type Recording struct {
ID int64 `json:"id"`
Kind string `json:"kind"` // "motion", "ding", "on_demand"
Answered bool `json:"answered"`
CreatedAt string `json:"created_at"`
DeviceID int64 `json:"device_id"`
}
Recording represents a recording/event from a Ring device
type RecordingHistoryResponse ¶
type RecordingHistoryResponse struct {
Recordings []*Recording `json:"recordings"`
}
RecordingHistoryResponse represents the response from listing recordings
type Requires2FAError ¶
type Requires2FAError struct {
Message string
}
Requires2FAError represents an error when 2FA is required
func NewRequires2FAError ¶
func NewRequires2FAError(message string) *Requires2FAError
NewRequires2FAError creates a new Requires2FAError
func (*Requires2FAError) Error ¶
func (e *Requires2FAError) Error() string
type StickUpCam ¶
type StickUpCam struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Family string `json:"family"`
Address string `json:"address"`
Timezone string `json:"timezone"`
WifiName string `json:"wifi_name"`
WifiSignalStrength int `json:"wifi_signal_strength"`
Volume int `json:"volume"`
HasLight bool `json:"has_light"`
LightBrightness *int `json:"light_brightness,omitempty"`
MotionDetectionEnabled bool `json:"motion_detection_enabled"`
Health *DeviceHealth `json:"health,omitempty"`
}
StickUpCam represents a Ring StickUp camera device
func (*StickUpCam) GetAddress ¶
func (s *StickUpCam) GetAddress() string
func (*StickUpCam) GetFamily ¶
func (s *StickUpCam) GetFamily() DeviceFamily
func (*StickUpCam) GetID ¶
func (s *StickUpCam) GetID() string
func (*StickUpCam) GetName ¶
func (s *StickUpCam) GetName() string
func (*StickUpCam) GetTimezone ¶
func (s *StickUpCam) GetTimezone() string
type TokenError ¶
TokenError represents a token retrieval or validation error
func NewTokenError ¶
func NewTokenError(message string, err error) *TokenError
NewTokenError creates a new TokenError
func (*TokenError) Error ¶
func (e *TokenError) Error() string
func (*TokenError) Unwrap ¶
func (e *TokenError) Unwrap() error
type UnauthorizedError ¶
type UnauthorizedError struct {
}
UnauthorizedError represents an unauthorized error
func NewUnauthorizedError ¶
func NewUnauthorizedError(message string, err error) *UnauthorizedError
NewUnauthorizedError creates a new UnauthorizedError
func (*UnauthorizedError) Error ¶
func (e *UnauthorizedError) Error() string
func (*UnauthorizedError) Unwrap ¶
func (e *UnauthorizedError) Unwrap() error
type VideoStream ¶
type VideoStream struct {
Body io.ReadCloser
ContentType string
ContentLen int64
Headers http.Header
}
VideoStream represents a video stream response from the Ring API