本文整理汇总了Golang中github.com/google/cups-connector/lib.Config.CUPSMaxConnections方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.CUPSMaxConnections方法的具体用法?Golang Config.CUPSMaxConnections怎么用?Golang Config.CUPSMaxConnections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/google/cups-connector/lib.Config
的用法示例。
在下文中一共展示了Config.CUPSMaxConnections方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: updateConfig
func updateConfig(config *lib.Config, configMap map[string]interface{}) bool {
dirty := commonUpdateConfig(config, configMap)
if _, exists := configMap["log_file_name"]; !exists {
dirty = true
fmt.Println("Added log_file_name")
config.LogFileName = lib.DefaultConfig.LogFileName
}
if _, exists := configMap["log_file_max_megabytes"]; !exists {
dirty = true
fmt.Println("Added log_file_max_megabytes")
config.LogFileMaxMegabytes = lib.DefaultConfig.LogFileMaxMegabytes
}
if _, exists := configMap["log_max_files"]; !exists {
dirty = true
fmt.Println("Added log_max_files")
config.LogMaxFiles = lib.DefaultConfig.LogMaxFiles
}
if _, exists := configMap["log_to_journal"]; !exists {
dirty = true
fmt.Println("Added log_to_journal")
config.LogToJournal = lib.DefaultConfig.LogToJournal
}
if _, exists := configMap["monitor_socket_filename"]; !exists {
dirty = true
fmt.Println("Added monitor_socket_filename")
config.MonitorSocketFilename = lib.DefaultConfig.MonitorSocketFilename
}
if _, exists := configMap["cups_max_connections"]; !exists {
dirty = true
fmt.Println("Added cups_max_connections")
config.CUPSMaxConnections = lib.DefaultConfig.CUPSMaxConnections
}
if _, exists := configMap["cups_connect_timeout"]; !exists {
dirty = true
fmt.Println("Added cups_connect_timeout")
config.CUPSConnectTimeout = lib.DefaultConfig.CUPSConnectTimeout
}
if _, exists := configMap["cups_printer_attributes"]; !exists {
dirty = true
fmt.Println("Added cups_printer_attributes")
config.CUPSPrinterAttributes = lib.DefaultConfig.CUPSPrinterAttributes
} else {
// Make sure all required attributes are present.
s := make(map[string]struct{}, len(config.CUPSPrinterAttributes))
for _, a := range config.CUPSPrinterAttributes {
s[a] = struct{}{}
}
for _, a := range lib.DefaultConfig.CUPSPrinterAttributes {
if _, exists := s[a]; !exists {
dirty = true
fmt.Printf("Added %s to cups_printer_attributes\n", a)
config.CUPSPrinterAttributes = append(config.CUPSPrinterAttributes, a)
}
}
}
if _, exists := configMap["cups_job_full_username"]; !exists {
dirty = true
fmt.Println("Added cups_job_full_username")
config.CUPSJobFullUsername = lib.DefaultConfig.CUPSJobFullUsername
}
if _, exists := configMap["cups_ignore_raw_printers"]; !exists {
dirty = true
fmt.Println("Added cups_ignore_raw_printers")
config.CUPSIgnoreRawPrinters = lib.DefaultConfig.CUPSIgnoreRawPrinters
}
if _, exists := configMap["cups_ignore_class_printers"]; !exists {
dirty = true
fmt.Println("Added cups_ignore_class_printers")
config.CUPSIgnoreClassPrinters = lib.DefaultConfig.CUPSIgnoreClassPrinters
}
if _, exists := configMap["copy_printer_info_to_display_name"]; !exists {
dirty = true
fmt.Println("Added copy_printer_info_to_display_name")
config.CUPSCopyPrinterInfoToDisplayName = lib.DefaultConfig.CUPSCopyPrinterInfoToDisplayName
}
return dirty
}