diff --git a/pkg/nest/api.go b/pkg/nest/api.go index 8aae2df2..80a421ba 100644 --- a/pkg/nest/api.go +++ b/pkg/nest/api.go @@ -23,7 +23,7 @@ type API struct { StreamSessionID string // RTSP - StreamToken string + StreamToken string StreamExtensionToken string extendTimer *time.Timer @@ -120,7 +120,7 @@ func (a *API) GetDevices(projectID string) (map[string]string, error) { supported := false for _, protocol := range device.Traits.SdmDevicesTraitsCameraLiveStream.SupportedProtocols { - if (protocol == "WEB_RTC" || protocol == "RTSP") { + if protocol == "WEB_RTC" || protocol == "RTSP" { supported = true break } @@ -231,7 +231,7 @@ func (a *API) ExtendStream() error { var reqv struct { Command string `json:"command"` Params struct { - MediaSessionID string `json:"mediaSessionId,omitempty"` + MediaSessionID string `json:"mediaSessionId,omitempty"` StreamExtensionToken string `json:"streamExtensionToken,omitempty"` } `json:"params"` } @@ -272,10 +272,10 @@ func (a *API) ExtendStream() error { var resv struct { Results struct { - ExpiresAt time.Time `json:"expiresAt"` - MediaSessionID string `json:"mediaSessionId"` - StreamExtensionToken string `json:"streamExtensionToken"` - StreamToken string `json:"streamToken"` + ExpiresAt time.Time `json:"expiresAt"` + MediaSessionID string `json:"mediaSessionId"` + StreamExtensionToken string `json:"streamExtensionToken"` + StreamToken string `json:"streamToken"` } `json:"results"` } @@ -293,8 +293,8 @@ func (a *API) ExtendStream() error { func (a *API) GenerateRtspStream(projectID, deviceID string) (string, error) { var reqv struct { - Command string `json:"command"` - Params struct {} `json:"params"` + Command string `json:"command"` + Params struct{} `json:"params"` } reqv.Command = "sdm.devices.commands.CameraLiveStream.GenerateRtspStream" @@ -324,10 +324,10 @@ func (a *API) GenerateRtspStream(projectID, deviceID string) (string, error) { var resv struct { Results struct { - StreamURLs map[string]string `json:"streamUrls"` - StreamExtensionToken string `json:"streamExtensionToken"` - StreamToken string `json:"streamToken"` - ExpiresAt time.Time `json:"expiresAt"` + StreamURLs map[string]string `json:"streamUrls"` + StreamExtensionToken string `json:"streamExtensionToken"` + StreamToken string `json:"streamToken"` + ExpiresAt time.Time `json:"expiresAt"` } `json:"results"` } diff --git a/pkg/nest/client.go b/pkg/nest/client.go index 5fc589cb..6d867dea 100644 --- a/pkg/nest/client.go +++ b/pkg/nest/client.go @@ -17,7 +17,7 @@ type WebRTCClient struct { type RTSPClient struct { conn *rtsp.Conn - api *API + api *API } func Dial(rawURL string) (core.Producer, error) { @@ -168,4 +168,4 @@ func (c *RTSPClient) Stop() error { func (c *RTSPClient) MarshalJSON() ([]byte, error) { return c.conn.MarshalJSON() -} \ No newline at end of file +}