entitlementdriver

package
v1.0.0-beta.186 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Parser = parser{}

Functions

func MapEntitlementGrantToAPI

func MapEntitlementGrantToAPI(subjectKey *string, grant *meteredentitlement.EntitlementGrant) api.EntitlementGrant

func MapEntitlementValueToAPI

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

func ParseAPICreateInput

func ParseAPICreateInput(inp *api.EntitlementCreateInputs, ns string, subjectIdOrKey string) (entitlement.CreateEntitlementInputs, error)

Types

type CreateEntitlementHandlerParams

type CreateEntitlementHandlerParams = string

type CreateEntitlementHandlerRequest

type CreateEntitlementHandlerRequest = entitlement.CreateEntitlementInputs

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
	GetEntitlement() GetEntitlementHandler
	GetEntitlementById() GetEntitlementByIdHandler
	DeleteEntitlement() DeleteEntitlementHandler
	GetEntitlementValue() GetEntitlementValueHandler
	GetEntitlementsOfSubjectHandler() GetEntitlementsOfSubjectHandler
	ListEntitlements() ListEntitlementsHandler
}

func NewEntitlementHandler

func NewEntitlementHandler(
	connector entitlement.Connector,
	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 = models.NamespacedID

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.Connector,
	balanceConnector meteredentitlement.Connector,
	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{}

Jump to

Keyboard shortcuts

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