Skip to content

Commit

Permalink
New Messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
daemonl committed Jun 10, 2024
1 parent 5cf245d commit 5b665e3
Show file tree
Hide file tree
Showing 14 changed files with 326 additions and 124 deletions.
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins:
out: .
opt: paths=import,module=github.com/pentops/registry

- name: go-messaging # github.com/pentops/protoc-gen-go-messaging
- name: go-o5-messaging # github.com/pentops/o5-messaging.go/cmd/protoc-gen-go-o5-messaging
out: .
opt: paths=import,module=github.com/pentops/registry

Expand Down
6 changes: 3 additions & 3 deletions buildwrap/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/pentops/j5/gen/j5/source/v1/source_j5pb"
"github.com/pentops/log.go/log"
"github.com/pentops/o5-go/messaging/v1/messaging_pb"
"github.com/pentops/outbox.pg.go/outbox"
"github.com/pentops/o5-messaging.go/o5msg"
"github.com/pentops/registry/gen/o5/registry/builder/v1/builder_tpb"
"github.com/pentops/registry/github"
"google.golang.org/protobuf/types/known/emptypb"
Expand All @@ -26,7 +26,7 @@ type Storage interface {
}

type Publisher interface {
Publish(ctx context.Context, msg ...outbox.OutboxMessage) error
Publish(ctx context.Context, msg o5msg.Message) error
}

type BuildWorker struct {
Expand All @@ -48,7 +48,7 @@ type IGithub interface {
GetCommit(ctx context.Context, ref github.RepoRef) (*source_j5pb.CommitInfo, error)
}

func NewBuildWorker(builder J5Builder, github IGithub, store Storage, publisher Publisher) *BuildWorker {
func NewBuildWorker(builder J5Builder, github IGithub, store Storage, publisher o5msg.Publisher) *BuildWorker {
return &BuildWorker{
builder: builder,
github: github,
Expand Down
11 changes: 3 additions & 8 deletions cmd/registry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/pentops/outbox.pg.go/outbox"
"github.com/pentops/o5-messaging.go/outbox"
)

var Version = "0.0.0"
Expand Down Expand Up @@ -124,7 +124,7 @@ func runCombinedServer(ctx context.Context, cfg struct {
return err
}

dbPublisher, err := outbox.NewDBPublisher(db)
dbPublisher, err := outbox.NewDirectPublisher(db, outbox.DefaultSender)
if err != nil {
return err
}
Expand All @@ -137,12 +137,7 @@ func runCombinedServer(ctx context.Context, cfg struct {
return err
}

publisher, err := outbox.NewDBPublisher(db)
if err != nil {
return err
}

githubWorker, err := service.NewWebhookWorker(refStore, githubClient, publisher)
githubWorker, err := service.NewWebhookWorker(refStore, githubClient, dbPublisher)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions ext/db/00001_outbox.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
-- +goose Up
CREATE TABLE outbox (
id uuid PRIMARY KEY,
destination text NOT NULL,
message bytea NOT NULL,
data jsonb NOT NULL,
headers text NOT NULL
);

Expand Down
53 changes: 0 additions & 53 deletions gen/o5/registry/builder/v1/builder_tpb/builder_messaging.pb.go

This file was deleted.

207 changes: 207 additions & 0 deletions gen/o5/registry/builder/v1/builder_tpb/builder_o5_messaging.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

10 changes: 0 additions & 10 deletions gen/o5/registry/github/v1/github_spb/github_query_messaging.pb.go

This file was deleted.

17 changes: 0 additions & 17 deletions gen/o5/registry/github/v1/github_tpb/webhook_messaging.pb.go

This file was deleted.

Loading

0 comments on commit 5b665e3

Please sign in to comment.