entitlementdriver

package
v1.0.0-beta.224 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Parser = parser{}

Functions

func AnnotationsFromMetadata

func AnnotationsFromMetadata(metadata api.Metadata) models.Annotations

func GetErrorEncoder

func GetErrorEncoder() encoder.ErrorEncoder

func MapAPIPeriodIntervalToRecurrence

func MapAPIPeriodIntervalToRecurrence(interval api.RecurringPeriodInterval) (timeutil.RecurrenceInterval, error)

func MapEntitlementValueToAPI

func MapEntitlementValueToAPI(entitlementValue entitlement.EntitlementValue) (api.EntitlementValue, error)

func MetadataFromAnnotations

func MetadataFromAnnotations(annotations models.Annotations) *api.Metadata

Types

type CreateEntitlementHandlerParams

type CreateEntitlementHandlerParams = string

type CreateEntitlementHandlerRequest

type CreateEntitlementHandlerRequest = struct {
	Inputs         entitlement.CreateEntitlementInputs
	SubjectIdOrKey string
	Namespace      string
}

type CreateEntitlementHandlerResponse

type CreateEntitlementHandlerResponse = *api.Entitlement

type CreateGrantHandlerParams

type CreateGrantHandlerParams struct {
	SubjectKey                string
	EntitlementIdOrFeatureKey string
}

type CreateGrantHandlerRequest

type CreateGrantHandlerRequest struct {
	GrantInput                meteredentitlement.CreateEntitlementGrantInputs
	EntitlementIdOrFeatureKey string
	Namespace                 string
	SubjectKey                string
}

type CreateGrantHandlerResponse

type CreateGrantHandlerResponse = api.EntitlementGrant

type DeleteEntitlementHandlerParams

type DeleteEntitlementHandlerParams struct {
	EntitlementId string
}

type DeleteEntitlementHandlerRequest

type DeleteEntitlementHandlerRequest struct {
	EntitlementId string
	Namespace     string
}

type DeleteEntitlementHandlerResponse

type DeleteEntitlementHandlerResponse = interface{}

type EntitlementHandler

type EntitlementHandler interface {
	CreateEntitlement() CreateEntitlementHandler
	OverrideEntitlement() OverrideEntitlementHandler // Maybe rename (both here & API) to Supersede
	GetEntitlement() GetEntitlementHandler
	GetEntitlementById() GetEntitlementByIdHandler
	DeleteEntitlement() DeleteEntitlementHandler
	GetEntitlementValue() GetEntitlementValueHandler
	GetEntitlementsOfSubjectHandler() GetEntitlementsOfSubjectHandler
	ListEntitlements() ListEntitlementsHandler
}

func NewEntitlementHandler

func NewEntitlementHandler(
	connector entitlement.Service,
	customerService customer.Service,
	subjectService subject.Service,
	namespaceDecoder namespacedriver.NamespaceDecoder,
	options ...httptransport.HandlerOption,
) EntitlementHandler

type GetEntitlementBalanceHistoryHandlerParams

type GetEntitlementBalanceHistoryHandlerParams struct {
	EntitlementID string
	SubjectKey    string
	Params        api.GetEntitlementHistoryParams
}

type GetEntitlementBalanceHistoryHandlerRequest

type GetEntitlementBalanceHistoryHandlerRequest struct {
	ID models.NamespacedID
	// contains filtered or unexported fields
}

type GetEntitlementBalanceHistoryHandlerResponse

type GetEntitlementBalanceHistoryHandlerResponse = api.WindowedBalanceHistory

type GetEntitlementByIdHandlerParams

type GetEntitlementByIdHandlerParams struct {
	EntitlementId string
}

type GetEntitlementByIdHandlerRequest

type GetEntitlementByIdHandlerRequest struct {
	EntitlementId string
	Namespace     string
}

type GetEntitlementByIdHandlerResponse

type GetEntitlementByIdHandlerResponse = *api.Entitlement

type GetEntitlementHandlerParams

type GetEntitlementHandlerParams struct {
	EntitlementId string
}

type GetEntitlementHandlerRequest

type GetEntitlementHandlerRequest struct {
	EntitlementId string
	Namespace     string
}

type GetEntitlementHandlerResponse

type GetEntitlementHandlerResponse = *api.Entitlement

type GetEntitlementValueHandlerParams

type GetEntitlementValueHandlerParams struct {
	SubjectKey                string
	EntitlementIdOrFeatureKey string
	Params                    api.GetEntitlementValueParams
}

type GetEntitlementValueHandlerRequest

type GetEntitlementValueHandlerRequest struct {
	EntitlementIdOrFeatureKey string
	SubjectKey                string
	Namespace                 string
	At                        time.Time
}

type GetEntitlementValueHandlerResponse

type GetEntitlementValueHandlerResponse = api.EntitlementValue

type GetEntitlementsOfSubjectHandlerParams

type GetEntitlementsOfSubjectHandlerParams struct {
	SubjectIdOrKey string
	Params         api.ListSubjectEntitlementsParams
}

type GetEntitlementsOfSubjectHandlerRequest

type GetEntitlementsOfSubjectHandlerRequest = struct {
	Namespace      string
	SubjectIdOrKey string
	Params         api.ListSubjectEntitlementsParams
}

type GetEntitlementsOfSubjectHandlerResponse

type GetEntitlementsOfSubjectHandlerResponse = []api.Entitlement

type ListEntitlementGrantHandlerRequest

type ListEntitlementGrantHandlerRequest struct {
	EntitlementIdOrFeatureKey string
	Namespace                 string
	SubjectKey                string
}

type ListEntitlementGrantHandlerResponse

type ListEntitlementGrantHandlerResponse = []api.EntitlementGrant

type ListEntitlementGrantsHandlerParams

type ListEntitlementGrantsHandlerParams struct {
	EntitlementIdOrFeatureKey string
	SubjectKey                string
}

type ListEntitlementsHandlerParams

type ListEntitlementsHandlerParams = api.ListEntitlementsParams

type ListEntitlementsHandlerRequest

type ListEntitlementsHandlerRequest = entitlement.ListEntitlementsParams

type MeteredEntitlementHandler

type MeteredEntitlementHandler interface {
	CreateGrant() CreateGrantHandler
	ListEntitlementGrants() ListEntitlementGrantsHandler
	ResetEntitlementUsage() ResetEntitlementUsageHandler
	GetEntitlementBalanceHistory() GetEntitlementBalanceHistoryHandler
}

func NewMeteredEntitlementHandler

func NewMeteredEntitlementHandler(
	entitlementConnector entitlement.Service,
	balanceConnector meteredentitlement.Connector,
	customerService customer.Service,
	subjectService subject.Service,
	namespaceDecoder namespacedriver.NamespaceDecoder,
	options ...httptransport.HandlerOption,
) MeteredEntitlementHandler

type OverrideEntitlementHandlerParams

type OverrideEntitlementHandlerParams struct {
	SubjectIdOrKey            string
	EntitlementIdOrFeatureKey string
}

type OverrideEntitlementHandlerRequest

type OverrideEntitlementHandlerRequest struct {
	Inputs                    entitlement.CreateEntitlementInputs
	SubjectIdOrKey            string
	EntitlementIdOrFeatureKey string
}

type OverrideEntitlementHandlerResponse

type OverrideEntitlementHandlerResponse = *api.Entitlement

type ResetEntitlementUsageHandlerParams

type ResetEntitlementUsageHandlerParams struct {
	EntitlementID string
	SubjectKey    string
}

type ResetEntitlementUsageHandlerRequest

type ResetEntitlementUsageHandlerRequest struct {
	EntitlementID   string
	Namespace       string
	SubjectID       string
	At              time.Time
	RetainAnchor    bool
	PreserveOverage *bool
}

type ResetEntitlementUsageHandlerResponse

type ResetEntitlementUsageHandlerResponse = interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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