subscription

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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