event

package
v0.35.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanListener

type ChanListener struct {
	// contains filtered or unexported fields
}

ChanListener listens for audit logs and processes them blocking one event at a time

func NewChanListener

func NewChanListener(inputChan <-chan audit.Log, processor *Service) *ChanListener

func (*ChanListener) Listen

func (l *ChanListener) Listen(ctx context.Context) error

Listen listens for audit logs and processes them

func (*ChanListener) Process

func (l *ChanListener) Process(ctx context.Context, log audit.Log)

type ChanPublisher

type ChanPublisher struct {
	// contains filtered or unexported fields
}

ChanPublisher is a blocking audit event publisher

func NewChanPublisher

func NewChanPublisher(target chan<- audit.Log) *ChanPublisher

func (*ChanPublisher) Publish

func (p *ChanPublisher) Publish(ctx context.Context, log audit.Log)

type CheckoutService

type CheckoutService interface {
	Apply(ctx context.Context, ch checkout.Checkout) (*subscription.Subscription, *product.Product, error)
	TriggerSyncByProviderID(ctx context.Context, id string) error
}

type CreditService added in v0.17.0

type CreditService interface {
	Add(ctx context.Context, ch credit.Credit) error
}

type CustomerService

type CustomerService interface {
	Create(ctx context.Context, customer customer.Customer, offline bool) (customer.Customer, error)
	TriggerSyncByProviderID(ctx context.Context, id string) error
	List(ctx context.Context, flt customer.Filter) ([]customer.Customer, error)
}

type OrganizationService

type OrganizationService interface {
	GetRaw(ctx context.Context, id string) (organization.Organization, error)
}

type PlanService

type PlanService interface {
	GetByID(ctx context.Context, id string) (plan.Plan, error)
}

type ProviderWebhookEvent added in v0.13.0

type ProviderWebhookEvent struct {
	Name string
	Body []byte
}

type Service added in v0.13.0

type Service struct {
	// contains filtered or unexported fields
}

func NewService added in v0.13.0

func NewService(billingConf billing.Config, organizationService OrganizationService,
	checkoutService CheckoutService, customerService CustomerService,
	planService PlanService, userService UserService,
	subsService SubscriptionService, creditService CreditService) *Service

func (*Service) BillingWebhook added in v0.13.0

func (p *Service) BillingWebhook(ctx context.Context, payload ProviderWebhookEvent) error

func (*Service) EnsureDefaultPlan added in v0.13.0

func (p *Service) EnsureDefaultPlan(ctx context.Context, orgID string) error

EnsureDefaultPlan create a new customer account and subscribe to the default plan if configured

type SubscriptionService added in v0.13.0

type SubscriptionService interface {
	TriggerSyncByProviderID(ctx context.Context, id string) error
}

type UserService

type UserService interface {
	ListByOrg(ctx context.Context, orgID string, roleFilter string) ([]user.User, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL