use updated honeybee api
This commit is contained in:
+5
-5
@@ -3,7 +3,7 @@ package prism
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"git.wisehodl.dev/jay/go-honeybee"
|
||||
honeybee "git.wisehodl.dev/jay/go-honeybee/outbound"
|
||||
"git.wisehodl.dev/jay/go-mana-component"
|
||||
"git.wisehodl.dev/jay/go-roots-ws"
|
||||
"log/slog"
|
||||
@@ -19,7 +19,7 @@ type EmbassyPlugin struct {
|
||||
Connect func(url string) error
|
||||
Remove func(url string) error
|
||||
Send func(url string, data []byte) error
|
||||
Events <-chan honeybee.OutboundPoolEvent
|
||||
Events <-chan honeybee.PoolEvent
|
||||
Inbox <-chan honeybee.InboxMessage
|
||||
}
|
||||
|
||||
@@ -31,11 +31,11 @@ const (
|
||||
EventEmbassyUnknown
|
||||
)
|
||||
|
||||
func mapEmbassyEvent(kind honeybee.OutboundPoolEventKind) EmbassyEventKind {
|
||||
func mapEmbassyEvent(kind honeybee.PoolEventKind) EmbassyEventKind {
|
||||
switch kind {
|
||||
case honeybee.OutboundEventConnected:
|
||||
case honeybee.EventConnected:
|
||||
return EventConnected
|
||||
case honeybee.OutboundEventDisconnected:
|
||||
case honeybee.EventDisconnected:
|
||||
return EventDisconnected
|
||||
default:
|
||||
return EventEmbassyUnknown
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
package prism
|
||||
|
||||
import (
|
||||
"git.wisehodl.dev/jay/go-honeybee"
|
||||
honeybee "git.wisehodl.dev/jay/go-honeybee/outbound"
|
||||
"git.wisehodl.dev/jay/go-roots-ws"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"sync/atomic"
|
||||
@@ -40,10 +40,10 @@ func TestEmbassy_Dispatch(t *testing.T) {
|
||||
close(inboxDone)
|
||||
}()
|
||||
|
||||
p.events <- honeybee.OutboundPoolEvent{
|
||||
ID: p.url, Kind: honeybee.OutboundEventConnected, At: time.Now()}
|
||||
p.events <- honeybee.OutboundPoolEvent{
|
||||
ID: "wss://other", Kind: honeybee.OutboundEventConnected, At: time.Now()}
|
||||
p.events <- honeybee.PoolEvent{
|
||||
ID: p.url, Kind: honeybee.EventConnected, At: time.Now()}
|
||||
p.events <- honeybee.PoolEvent{
|
||||
ID: "wss://other", Kind: honeybee.EventConnected, At: time.Now()}
|
||||
p.inbox <- honeybee.InboxMessage{
|
||||
ID: p.url,
|
||||
Data: envelope.EncloseEvent([]byte("{}")),
|
||||
|
||||
@@ -3,13 +3,13 @@ module git.wisehodl.dev/jay/go-mana-prism
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
git.wisehodl.dev/jay/go-honeybee v0.2.0
|
||||
git.wisehodl.dev/jay/go-honeybee v0.3.0
|
||||
git.wisehodl.dev/jay/go-mana-component v0.1.0
|
||||
git.wisehodl.dev/jay/go-roots-ws v0.1.0
|
||||
github.com/stretchr/testify v1.11.1
|
||||
)
|
||||
|
||||
require (
|
||||
git.wisehodl.dev/jay/go-mana-component v0.1.0 // indirect
|
||||
git.wisehodl.dev/jay/go-roots-ws v0.1.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
|
||||
+7
-7
@@ -2,7 +2,7 @@ package prism
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.wisehodl.dev/jay/go-honeybee"
|
||||
honeybee "git.wisehodl.dev/jay/go-honeybee/outbound"
|
||||
"git.wisehodl.dev/jay/go-mana-component"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
@@ -33,7 +33,7 @@ type mockPool struct {
|
||||
url string
|
||||
added chan struct{}
|
||||
removed chan struct{}
|
||||
events chan honeybee.OutboundPoolEvent
|
||||
events chan honeybee.PoolEvent
|
||||
inbox chan honeybee.InboxMessage
|
||||
sent chan []byte
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func newMockPool(t *testing.T) *mockPool {
|
||||
|
||||
added := make(chan struct{})
|
||||
removed := make(chan struct{})
|
||||
events := make(chan honeybee.OutboundPoolEvent, 16)
|
||||
events := make(chan honeybee.PoolEvent, 16)
|
||||
inbox := make(chan honeybee.InboxMessage, 16)
|
||||
sent := make(chan []byte, 16)
|
||||
|
||||
@@ -73,13 +73,13 @@ func newMockPool(t *testing.T) *mockPool {
|
||||
}
|
||||
|
||||
func (p *mockPool) connect() {
|
||||
p.events <- honeybee.OutboundPoolEvent{
|
||||
ID: p.url, Kind: honeybee.OutboundEventConnected, At: time.Now()}
|
||||
p.events <- honeybee.PoolEvent{
|
||||
ID: p.url, Kind: honeybee.EventConnected, At: time.Now()}
|
||||
}
|
||||
|
||||
func (p *mockPool) disconnect() {
|
||||
p.events <- honeybee.OutboundPoolEvent{
|
||||
ID: p.url, Kind: honeybee.OutboundEventDisconnected, At: time.Now()}
|
||||
p.events <- honeybee.PoolEvent{
|
||||
ID: p.url, Kind: honeybee.EventDisconnected, At: time.Now()}
|
||||
}
|
||||
|
||||
func (p *mockPool) receive(data []byte) {
|
||||
|
||||
Reference in New Issue
Block a user