mirror of
https://github.com/hanzoai/psrpc.git
synced 2026-09-30 23:47:22 +00:00
PSRPC for Hanzo LiveKit, forked from livekit/psrpc (Apache-2.0). Two rewrites: github.com/livekit/psrpc -> github.com/hanzoai/psrpc github.com/redis/go-redis/v9 -> github.com/hanzokv/go/v9 psrpc's message bus (bus.go, internal/bus/bus_redis.go, internal/bus/bustest) speaks to a KV over go-redis. After hanzoai/livekit moved to our client, psrpc was the one remaining edge pulling upstream go-redis into that binary — not our code, but our dependency, the same shape redsync had for hanzoai/git. The other livekit/* modules (protocol, mediatransportutil, mageutil) are NOT forked and should not be: none of them touch a KV client, so they are ordinary external dependencies and their names are addresses.
29 lines
436 B
Go
29 lines
436 B
Go
package bustest
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ory/dockertest/v4"
|
|
|
|
"github.com/hanzoai/psrpc/internal/bus"
|
|
)
|
|
|
|
func init() {
|
|
RegisterServer("Local", func(t testing.TB, pool dockertest.Pool) Server {
|
|
return NewLocalBus()
|
|
})
|
|
}
|
|
|
|
func NewLocalBus() Server {
|
|
b := bus.NewLocalMessageBus()
|
|
return &localBus{b: b}
|
|
}
|
|
|
|
type localBus struct {
|
|
b bus.MessageBus
|
|
}
|
|
|
|
func (s *localBus) Connect(t testing.TB) bus.MessageBus {
|
|
return s.b
|
|
}
|