use updated honeybee api

This commit is contained in:
Jay
2026-05-18 09:33:25 -04:00
parent b466b9f5ab
commit 85e53ce1b5
4 changed files with 20 additions and 20 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ package prism
import ( import (
"context" "context"
"fmt" "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-mana-component"
"git.wisehodl.dev/jay/go-roots-ws" "git.wisehodl.dev/jay/go-roots-ws"
"log/slog" "log/slog"
@@ -19,7 +19,7 @@ type EmbassyPlugin struct {
Connect func(url string) error Connect func(url string) error
Remove func(url string) error Remove func(url string) error
Send func(url string, data []byte) error Send func(url string, data []byte) error
Events <-chan honeybee.OutboundPoolEvent Events <-chan honeybee.PoolEvent
Inbox <-chan honeybee.InboxMessage Inbox <-chan honeybee.InboxMessage
} }
@@ -31,11 +31,11 @@ const (
EventEmbassyUnknown EventEmbassyUnknown
) )
func mapEmbassyEvent(kind honeybee.OutboundPoolEventKind) EmbassyEventKind { func mapEmbassyEvent(kind honeybee.PoolEventKind) EmbassyEventKind {
switch kind { switch kind {
case honeybee.OutboundEventConnected: case honeybee.EventConnected:
return EventConnected return EventConnected
case honeybee.OutboundEventDisconnected: case honeybee.EventDisconnected:
return EventDisconnected return EventDisconnected
default: default:
return EventEmbassyUnknown return EventEmbassyUnknown
+5 -5
View File
@@ -1,7 +1,7 @@
package prism package prism
import ( import (
"git.wisehodl.dev/jay/go-honeybee" honeybee "git.wisehodl.dev/jay/go-honeybee/outbound"
"git.wisehodl.dev/jay/go-roots-ws" "git.wisehodl.dev/jay/go-roots-ws"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"sync/atomic" "sync/atomic"
@@ -40,10 +40,10 @@ func TestEmbassy_Dispatch(t *testing.T) {
close(inboxDone) close(inboxDone)
}() }()
p.events <- honeybee.OutboundPoolEvent{ p.events <- honeybee.PoolEvent{
ID: p.url, Kind: honeybee.OutboundEventConnected, At: time.Now()} ID: p.url, Kind: honeybee.EventConnected, At: time.Now()}
p.events <- honeybee.OutboundPoolEvent{ p.events <- honeybee.PoolEvent{
ID: "wss://other", Kind: honeybee.OutboundEventConnected, At: time.Now()} ID: "wss://other", Kind: honeybee.EventConnected, At: time.Now()}
p.inbox <- honeybee.InboxMessage{ p.inbox <- honeybee.InboxMessage{
ID: p.url, ID: p.url,
Data: envelope.EncloseEvent([]byte("{}")), Data: envelope.EncloseEvent([]byte("{}")),
+3 -3
View File
@@ -3,13 +3,13 @@ module git.wisehodl.dev/jay/go-mana-prism
go 1.25.0 go 1.25.0
require ( 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 github.com/stretchr/testify v1.11.1
) )
require ( 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/davecgh/go-spew v1.1.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect github.com/gorilla/websocket v1.5.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
+7 -7
View File
@@ -2,7 +2,7 @@ package prism
import ( import (
"context" "context"
"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-mana-component"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing" "testing"
@@ -33,7 +33,7 @@ type mockPool struct {
url string url string
added chan struct{} added chan struct{}
removed chan struct{} removed chan struct{}
events chan honeybee.OutboundPoolEvent events chan honeybee.PoolEvent
inbox chan honeybee.InboxMessage inbox chan honeybee.InboxMessage
sent chan []byte sent chan []byte
} }
@@ -48,7 +48,7 @@ func newMockPool(t *testing.T) *mockPool {
added := make(chan struct{}) added := make(chan struct{})
removed := 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) inbox := make(chan honeybee.InboxMessage, 16)
sent := make(chan []byte, 16) sent := make(chan []byte, 16)
@@ -73,13 +73,13 @@ func newMockPool(t *testing.T) *mockPool {
} }
func (p *mockPool) connect() { func (p *mockPool) connect() {
p.events <- honeybee.OutboundPoolEvent{ p.events <- honeybee.PoolEvent{
ID: p.url, Kind: honeybee.OutboundEventConnected, At: time.Now()} ID: p.url, Kind: honeybee.EventConnected, At: time.Now()}
} }
func (p *mockPool) disconnect() { func (p *mockPool) disconnect() {
p.events <- honeybee.OutboundPoolEvent{ p.events <- honeybee.PoolEvent{
ID: p.url, Kind: honeybee.OutboundEventDisconnected, At: time.Now()} ID: p.url, Kind: honeybee.EventDisconnected, At: time.Now()}
} }
func (p *mockPool) receive(data []byte) { func (p *mockPool) receive(data []byte) {