Skip to content

Commit

Permalink
Merge pull request #1286 from openmeterio/chore/export-dependencies
Browse files Browse the repository at this point in the history
chore: expose balance and notification types
  • Loading branch information
turip authored Aug 1, 2024
2 parents 38249ae + b63d0af commit 782f142
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 5 deletions.
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)
}

0 comments on commit 782f142

Please sign in to comment.