Refactor XML response handling in device extended and security tests

- Adjusted formatting in XML response strings for consistency in device_extended_test.go and device_security_test.go.
- Improved readability by aligning XML declaration and body content.
- Updated mock server responses to ensure proper handling of various ONVIF operations.

Enhance device security and storage handling

- Refactored struct field declarations in device_security.go and device_storage_test.go for improved clarity.
- Ensured consistent formatting across struct definitions and XML tags.

Standardize whitespace and formatting across multiple files

- Removed unnecessary blank lines and adjusted indentation in discovery, imaging, media, and PTZ server files.
- Improved overall code readability and maintainability by ensuring consistent formatting.

Update example applications for better readability

- Cleaned up whitespace in example applications to enhance code clarity.
- Ensured consistent formatting in main.go files across various examples.

Refactor server and SOAP handler code for consistency

- Standardized struct field declarations and XML tag formatting in server and SOAP handler files.
- Improved readability by aligning struct fields and ensuring consistent use of whitespace.

General code cleanup and formatting adjustments

- Applied consistent formatting across various files, including types.go and test files.
- Enhanced readability by aligning struct fields and removing unnecessary blank lines.
This commit is contained in:
ProtoTess
2025-12-01 00:49:36 +00:00
parent 856f49c82d
commit b4e4982876
37 changed files with 318 additions and 322 deletions
+11 -11
View File
@@ -18,7 +18,7 @@ func (c *Client) GetDot11Capabilities(ctx context.Context) (*Dot11Capabilities,
}
type GetDot11CapabilitiesResponse struct {
XMLName xml.Name `xml:"GetDot11CapabilitiesResponse"`
XMLName xml.Name `xml:"GetDot11CapabilitiesResponse"`
Capabilities *Dot11Capabilities `xml:"Capabilities"`
}
@@ -73,14 +73,14 @@ func (c *Client) GetDot11Status(ctx context.Context, interfaceToken string) (*Do
// ONVIF Specification: GetDot1XConfiguration operation
func (c *Client) GetDot1XConfiguration(ctx context.Context, configToken string) (*Dot1XConfiguration, error) {
type GetDot1XConfigurationBody struct {
XMLName xml.Name `xml:"tds:GetDot1XConfiguration"`
Xmlns string `xml:"xmlns:tds,attr"`
Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"`
XMLName xml.Name `xml:"tds:GetDot1XConfiguration"`
Xmlns string `xml:"xmlns:tds,attr"`
Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"`
}
type GetDot1XConfigurationResponse struct {
XMLName xml.Name `xml:"GetDot1XConfigurationResponse"`
Dot1XConfiguration *Dot1XConfiguration `xml:"Dot1XConfiguration"`
XMLName xml.Name `xml:"GetDot1XConfigurationResponse"`
Dot1XConfiguration *Dot1XConfiguration `xml:"Dot1XConfiguration"`
}
request := GetDot1XConfigurationBody{
@@ -109,8 +109,8 @@ func (c *Client) GetDot1XConfigurations(ctx context.Context) ([]*Dot1XConfigurat
}
type GetDot1XConfigurationsResponse struct {
XMLName xml.Name `xml:"GetDot1XConfigurationsResponse"`
Dot1XConfiguration []*Dot1XConfiguration `xml:"Dot1XConfiguration"`
XMLName xml.Name `xml:"GetDot1XConfigurationsResponse"`
Dot1XConfiguration []*Dot1XConfiguration `xml:"Dot1XConfiguration"`
}
request := GetDot1XConfigurationsBody{
@@ -193,9 +193,9 @@ func (c *Client) CreateDot1XConfiguration(ctx context.Context, config *Dot1XConf
// ONVIF Specification: DeleteDot1XConfiguration operation
func (c *Client) DeleteDot1XConfiguration(ctx context.Context, configToken string) error {
type DeleteDot1XConfigurationBody struct {
XMLName xml.Name `xml:"tds:DeleteDot1XConfiguration"`
Xmlns string `xml:"xmlns:tds,attr"`
Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"`
XMLName xml.Name `xml:"tds:DeleteDot1XConfiguration"`
Xmlns string `xml:"xmlns:tds,attr"`
Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"`
}
type DeleteDot1XConfigurationResponse struct {