refactor: introduce constants for improved maintainability in tests and server configurations
- Added constants for test endpoints, usernames, and XML headers in client_test.go and device_certificates_test.go to enhance readability and reduce hardcoded values. - Updated various test cases to utilize these constants, ensuring consistency across tests. - Refactored imaging settings and server configurations to use defined constants for default values, improving clarity and maintainability in server/device.go and server/imaging.go. - Enhanced comments throughout the code to clarify functionality and adhere to best practices.
This commit is contained in:
+5
-1
@@ -142,7 +142,11 @@ func (c *Client) GetImagingSettings(ctx context.Context, videoSourceToken string
|
||||
}
|
||||
|
||||
// SetImagingSettings sets imaging settings for a video source.
|
||||
func (c *Client) SetImagingSettings(ctx context.Context, videoSourceToken string, settings *ImagingSettings, forcePersistence bool) error {
|
||||
//
|
||||
//nolint:funlen // SetImagingSettings has many statements due to building complex imaging settings request
|
||||
func (c *Client) SetImagingSettings(
|
||||
ctx context.Context, videoSourceToken string, settings *ImagingSettings, forcePersistence bool,
|
||||
) error {
|
||||
endpoint := c.imagingEndpoint
|
||||
if endpoint == "" {
|
||||
endpoint = c.endpoint
|
||||
|
||||
Reference in New Issue
Block a user