 9bdcbe0447
			
		
	
	9bdcbe0447
	
	
	
		
			
			Major integrations and fixes: - Added BACKBEAT SDK integration for P2P operation timing - Implemented beat-aware status tracking for distributed operations - Added Docker secrets support for secure license management - Resolved KACHING license validation via HTTPS/TLS - Updated docker-compose configuration for clean stack deployment - Disabled rollback policies to prevent deployment failures - Added license credential storage (CHORUS-DEV-MULTI-001) Technical improvements: - BACKBEAT P2P operation tracking with phase management - Enhanced configuration system with file-based secrets - Improved error handling for license validation - Clean separation of KACHING and CHORUS deployment stacks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			62 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package log
 | |
| 
 | |
| import (
 | |
| 	"fmt"
 | |
| 	"reflect"
 | |
| )
 | |
| 
 | |
| // InterleavedKVToFields converts keyValues a la Span.LogKV() to a Field slice
 | |
| // a la Span.LogFields().
 | |
| func InterleavedKVToFields(keyValues ...interface{}) ([]Field, error) {
 | |
| 	if len(keyValues)%2 != 0 {
 | |
| 		return nil, fmt.Errorf("non-even keyValues len: %d", len(keyValues))
 | |
| 	}
 | |
| 	fields := make([]Field, len(keyValues)/2)
 | |
| 	for i := 0; i*2 < len(keyValues); i++ {
 | |
| 		key, ok := keyValues[i*2].(string)
 | |
| 		if !ok {
 | |
| 			return nil, fmt.Errorf(
 | |
| 				"non-string key (pair #%d): %T",
 | |
| 				i, keyValues[i*2])
 | |
| 		}
 | |
| 		switch typedVal := keyValues[i*2+1].(type) {
 | |
| 		case bool:
 | |
| 			fields[i] = Bool(key, typedVal)
 | |
| 		case string:
 | |
| 			fields[i] = String(key, typedVal)
 | |
| 		case int:
 | |
| 			fields[i] = Int(key, typedVal)
 | |
| 		case int8:
 | |
| 			fields[i] = Int32(key, int32(typedVal))
 | |
| 		case int16:
 | |
| 			fields[i] = Int32(key, int32(typedVal))
 | |
| 		case int32:
 | |
| 			fields[i] = Int32(key, typedVal)
 | |
| 		case int64:
 | |
| 			fields[i] = Int64(key, typedVal)
 | |
| 		case uint:
 | |
| 			fields[i] = Uint64(key, uint64(typedVal))
 | |
| 		case uint64:
 | |
| 			fields[i] = Uint64(key, typedVal)
 | |
| 		case uint8:
 | |
| 			fields[i] = Uint32(key, uint32(typedVal))
 | |
| 		case uint16:
 | |
| 			fields[i] = Uint32(key, uint32(typedVal))
 | |
| 		case uint32:
 | |
| 			fields[i] = Uint32(key, typedVal)
 | |
| 		case float32:
 | |
| 			fields[i] = Float32(key, typedVal)
 | |
| 		case float64:
 | |
| 			fields[i] = Float64(key, typedVal)
 | |
| 		default:
 | |
| 			if typedVal == nil || (reflect.ValueOf(typedVal).Kind() == reflect.Ptr && reflect.ValueOf(typedVal).IsNil()) {
 | |
| 				fields[i] = String(key, "nil")
 | |
| 				continue
 | |
| 			}
 | |
| 			// When in doubt, coerce to a string
 | |
| 			fields[i] = String(key, fmt.Sprint(typedVal))
 | |
| 		}
 | |
| 	}
 | |
| 	return fields, nil
 | |
| }
 |