Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package icapclient
import (
"time"
)
// Config is the shared configuration for the icap client library.
type Config struct {
ICAPConn ICAPConnConfig
}
// DefaultConfig returns the default configuration for the icap client library.
func DefaultConfig() Config {
return Config{
ICAPConn: ICAPConnConfig{
Timeout: 15 * time.Second,
},
}
}
// ConfigOption is a function that configures the icap client.
type ConfigOption func(*Config)
// WithICAPConnectionTimeout sets the timeout for the connection to the icap server.
func WithICAPConnectionTimeout(timeout time.Duration) ConfigOption {
return func(cfg *Config) {
if timeout <= 0 {
return
}
cfg.ICAPConn.Timeout = timeout
}
}