gostations/browser.go

28 lines
911 B
Go
Raw Normal View History

2021-03-16 13:09:27 +00:00
package main
// Deprecated: implementation moved to internal/radio during reorg (Phase 1).
// This file provides shims for tests and any remaining same-package references
// during the transition. Remove after full migration of callers and tests.
import (
"context"
"github.com/gmgauthier/gostations/internal/radio"
)
// stationRecord is a type alias for backward compat in tests and old call sites.
type stationRecord = radio.Station
// StationSearch shim (used by some tests).
func StationSearch(name string, country string, state string, tags string, notok bool) ([]stationRecord, error) {
ss, err := radio.Search(context.Background(), name, country, state, tags, notok)
// convert slice of alias (identical underlying)
out := make([]stationRecord, len(ss))
for i := range ss {
out[i] = ss[i]
}
return out, err
}
// GetApiHost etc are intentionally not shimmed; new code uses internal/radio.