-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: expose event subsystem for the cloud deployment
- Loading branch information
Showing
8 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package noop | ||
package kafka | ||
|
||
import ( | ||
"github.com/ThreeDotsLabs/watermill/message" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package credit | ||
|
||
import "github.com/openmeterio/openmeter/internal/credit" | ||
|
||
const ( | ||
EventSubsystem = credit.EventSubsystem | ||
) | ||
|
||
const ( | ||
EventCreateGrant = credit.EventCreateGrant | ||
EventVoidGrant = credit.EventVoidGrant | ||
) | ||
|
||
type ( | ||
GrantCreatedEvent = credit.GrantCreatedEvent | ||
GrantVoidedEvent = credit.GrantVoidedEvent | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package entitlement | ||
|
||
import "github.com/openmeterio/openmeter/internal/entitlement" | ||
|
||
const ( | ||
EventSubsystem = entitlement.EventSubsystem | ||
) | ||
|
||
const ( | ||
EventCreateEntitlement = entitlement.EventCreateEntitlement | ||
EventDeleteEntitlement = entitlement.EventDeleteEntitlement | ||
) | ||
|
||
type ( | ||
EntitlementCreatedEvent = entitlement.EntitlementCreatedEvent | ||
EntitlementDeletedEvent = entitlement.EntitlementDeletedEvent | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package meteredentitlement | ||
|
||
import meteredentitlement "github.com/openmeterio/openmeter/internal/entitlement/metered" | ||
|
||
const ( | ||
EventSubsystem = meteredentitlement.EventSubsystem | ||
) | ||
|
||
const ( | ||
EventResetEntitlementUsage = meteredentitlement.EventResetEntitlementUsage | ||
) | ||
|
||
type ( | ||
ResetEntitlementEvent = meteredentitlement.ResetEntitlementEvent | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package kafka | ||
|
||
import ( | ||
"github.com/ThreeDotsLabs/watermill/message" | ||
"github.com/cloudevents/sdk-go/v2/event" | ||
"github.com/confluentinc/confluent-kafka-go/v2/kafka" | ||
|
||
watermillkafka "github.com/openmeterio/openmeter/internal/watermill/driver/kafka" | ||
) | ||
|
||
const ( | ||
PartitionKeyMetadataKey = watermillkafka.PartitionKeyMetadataKey | ||
) | ||
|
||
type ( | ||
Publisher = watermillkafka.Publisher | ||
) | ||
|
||
func NewPublisher(producer *kafka.Producer) *Publisher { | ||
return watermillkafka.NewPublisher(producer) | ||
} | ||
|
||
func AddPartitionKeyFromSubject(watermillIn *message.Message, cloudEvent event.Event) (*message.Message, error) { | ||
return watermillkafka.AddPartitionKeyFromSubject(watermillIn, cloudEvent) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package noop | ||
|
||
import "github.com/openmeterio/openmeter/internal/watermill/driver/noop" | ||
|
||
type ( | ||
Publisher = noop.Publisher | ||
) |