refactor: standardize constants and improve brightness calculations

- Replaced hardcoded values with constants for default dimensions and timeout settings in various files.
- Updated brightness calculation logic to use defined constants for maximum color value and bit shifts.
- Enhanced the ASCII image generation function to utilize new constants for improved readability and maintainability.
This commit is contained in:
0x524a
2025-12-02 08:53:13 -05:00
parent 96ac509c24
commit de752f249e
4 changed files with 36 additions and 12 deletions
+11 -1
View File
@@ -18,10 +18,20 @@ var (
)
//nolint:funlen // Main function has many statements due to server setup and configuration
const (
defaultPort = 8080
maxWorkers = 3
defaultTimeout = 30
ptzStepSize = 5
ptzMaxPan = 180
ptzMaxTilt = 90
ptzSpeed = 0.5
)
func main() {
// Define command-line flags
host := flag.String("host", "0.0.0.0", "Server host address")
port := flag.Int("port", 8080, "Server port")
port := flag.Int("port", defaultPort, "Server port")
username := flag.String("username", "admin", "Authentication username")
password := flag.String("password", "admin", "Authentication password")
manufacturer := flag.String("manufacturer", "onvif-go", "Device manufacturer")