entitlement

package
v0.8.36 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPlanEntitlementFailed = fmt.Errorf("plan entitlement failed")
)

Functions

This section is empty.

Types

type OrganizationService added in v0.8.18

type OrganizationService interface {
	MemberCount(ctx context.Context, orgID string) (int64, error)
}

type PlanService added in v0.8.18

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

type ProductService added in v0.8.14

type ProductService interface {
	List(ctx context.Context, f product.Filter) ([]product.Product, error)
	GetFeatureByID(ctx context.Context, id string) (product.Feature, error)
	GetByID(ctx context.Context, id string) (product.Product, error)
}

type Service

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

func NewEntitlementService

func NewEntitlementService(subscriptionService SubscriptionService,
	featureService ProductService, planService PlanService,
	organizationService OrganizationService) *Service

func (*Service) Check

func (s *Service) Check(ctx context.Context, customerID, featureOrProductID string) (bool, error)

Check checks if the customer has access to the feature or product

func (*Service) CheckPlanEligibility added in v0.8.18

func (s *Service) CheckPlanEligibility(ctx context.Context, customerID string) error

CheckPlanEligibility checks if the customer is eligible for the plan

type SubscriptionService

type SubscriptionService interface {
	List(ctx context.Context, filter subscription.Filter) ([]subscription.Subscription, error)
}

Jump to

Keyboard shortcuts

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