Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: expose balance and notification types #1286

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/balance-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import (

const (
defaultShutdownTimeout = 5 * time.Second
otelName = "openmeter.io/backend"
otelName = "openmeter.io/balance-worker"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/notification-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import (

const (
defaultShutdownTimeout = 5 * time.Second
otelName = "openmeter.io/backend"
otelName = "openmeter.io/notification-service"
)

func main() {
Expand Down
13 changes: 13 additions & 0 deletions openmeter/entitlement/balanceworker/worker.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package balanceworker

import "github.com/openmeterio/openmeter/internal/entitlement/balanceworker"

type (
Worker = balanceworker.Worker
WorkerOptions = balanceworker.WorkerOptions
WorkerDLQOptions = balanceworker.WorkerDLQOptions
)

func New(opts WorkerOptions) (*Worker, error) {
return balanceworker.New(opts)
}
15 changes: 12 additions & 3 deletions openmeter/event/publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ package publisher
import "github.com/openmeterio/openmeter/internal/event/publisher"

type (
Publisher = publisher.Publisher
PublisherOptions = publisher.PublisherOptions
TopicPublisher = publisher.TopicPublisher
Publisher = publisher.Publisher
PublisherOptions = publisher.PublisherOptions
TopicPublisher = publisher.TopicPublisher
CloudEventMarshaler = publisher.CloudEventMarshaler
)

type (
TransformFunc = publisher.TransformFunc
)

func NewPublisher(options PublisherOptions) (Publisher, error) {
return publisher.NewPublisher(options)
}

func NewCloudEventMarshaler(transform TransformFunc) CloudEventMarshaler {
return publisher.NewCloudEventMarshaler(transform)
}
13 changes: 13 additions & 0 deletions openmeter/notification/consumer/consumer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package consumer

import "github.com/openmeterio/openmeter/internal/notification/consumer"

type (
Options = consumer.Options
DLQOptions = consumer.DLQOptions
Consumer = consumer.Consumer
)

func New(opts Options) (*Consumer, error) {
return consumer.New(opts)
}
12 changes: 12 additions & 0 deletions openmeter/registry/entitlement.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package registry

import "github.com/openmeterio/openmeter/internal/registry"

type (
Entitlement = registry.Entitlement
EntitlementOptions = registry.EntitlementOptions
)

func GetEntitlementRegistry(opts EntitlementOptions) *Entitlement {
return registry.GetEntitlementRegistry(opts)
}
Loading