Documentation
¶
Index ¶
- type ConsumerInstanceGetter
- type Manager
- func (sm *Manager) GetSubscriptionSchemaName(pd config.PolicyDetail) string
- func (sm *Manager) ProcessSubscribe(subscription apic.Subscription)
- func (sm *Manager) ProcessUnsubscribe(subscription apic.Subscription)
- func (sm *Manager) RegisterNewSchema(schema StateManager)
- func (sm *Manager) Schemas() []apic.SubscriptionSchema
- func (sm *Manager) ValidateSubscription(subscription apic.Subscription) bool
- type SchemaHandler
- type StateManager
- type SubSchema
- type SubStateManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerInstanceGetter ¶
type ConsumerInstanceGetter interface {
GetConsumerInstanceByID(id string) (*v1alpha1.ConsumerInstance, error)
}
ConsumerInstanceGetter gets a consumer instance by id.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the subscription aspects
func New ¶
func New(log logrus.FieldLogger, cig ConsumerInstanceGetter, schemas ...StateManager) *Manager
New creates a SubscriptionManager
func (*Manager) GetSubscriptionSchemaName ¶
func (sm *Manager) GetSubscriptionSchemaName(pd config.PolicyDetail) string
GetSubscriptionSchemaName returns the appropriate subscription schema name given a policy
func (*Manager) ProcessSubscribe ¶
func (sm *Manager) ProcessSubscribe(subscription apic.Subscription)
ProcessUnsubscribe moves a subscription from Approved to Active.
func (*Manager) ProcessUnsubscribe ¶
func (sm *Manager) ProcessUnsubscribe(subscription apic.Subscription)
ProcessUnsubscribe moves a subscription from Unsubscribe Initiated to Unsubscribed.
func (*Manager) RegisterNewSchema ¶
func (sm *Manager) RegisterNewSchema(schema StateManager)
RegisterNewSchema registers a schema to represent a Mulesoft policy that can be subscribed to in the Catalog.
func (*Manager) Schemas ¶
func (sm *Manager) Schemas() []apic.SubscriptionSchema
func (*Manager) ValidateSubscription ¶
func (sm *Manager) ValidateSubscription(subscription apic.Subscription) bool
type SchemaHandler ¶
type SchemaHandler interface { GetSubscriptionSchemaName(pd config.PolicyDetail) string RegisterNewSchema(schema StateManager) }
type StateManager ¶
type StateManager interface { SubSchema Subscribe(log logrus.FieldLogger, subs apic.Subscription) error Unsubscribe(log logrus.FieldLogger, subs apic.Subscription) error }
StateManager handles subscription state changes.
type SubSchema ¶
type SubSchema interface { Schema() apic.SubscriptionSchema Name() string IsApplicable(policyDetail config.PolicyDetail) bool }
SubSchema the policy attached required to create a subscription.
type SubStateManager ¶
type SubStateManager struct { SubSchema // contains filtered or unexported fields }
SubStateManager handles the updates to the state of a subscription for a given schema/policy type.
func NewSubStateManager ¶
func NewSubStateManager(client anypoint.Client, policy SubSchema) *SubStateManager
NewSubStateManager creates a new
func (*SubStateManager) Subscribe ¶
func (ssm *SubStateManager) Subscribe(log logrus.FieldLogger, sub apic.Subscription) error
func (*SubStateManager) Unsubscribe ¶
func (ssm *SubStateManager) Unsubscribe(log logrus.FieldLogger, sub apic.Subscription) error