package service import ( "fmt" "github.com/google/uuid" ) const ( META = "service" ) func NewPool(services ...Service) (pool map[string]Service) { pool = make(map[string]Service) for i := range services { if services[i] == nil { continue } sid := services[i].String() if sid == "" { sid = uuid.NewString() } pool[sid] = services[i] } return } func Pool(v any) (map[string]Service, error) { pool, ok := v.(map[string]Service) if !ok { return nil, fmt.Errorf("illegal state: could not extract service pool") } return pool, nil }