Documentation
¶
Overview ¶
Package subscriptions is a generated GoMock package.
Package subscriptions is a generated GoMock package.
Index ¶
- Variables
- type Channel
- type ChannelFactory
- type CsdChannelFactory
- type InProcessChannelFactory
- type InProcessPubSubChannel
- type Manager
- type MockChannel
- type MockChannelFactory
- type MockChannelFactoryMockRecorder
- type MockChannelMockRecorder
- type MockManager
- type MockManagerMockRecorder
- type NotificationEvent
- type RestHookChannel
- type RetryableManager
Constants ¶
This section is empty.
Variables ¶
var ReceiverFailure = errors.New("FHIR subscription could not be delivered to receiver")
ReceiverFailure is returned when a FHIR subscription could not be delivered to the receiver, because the receiver is unreachable or didn't return a response indicating successful delivery.
var SendNotificationQueue = messaging.Entity{ Name: "orca.subscriptionmgr.notification", Prefix: true, }
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel interface {
Notify(ctx context.Context, notification coolfhir.SubscriptionNotification) error
}
type ChannelFactory ¶
type ChannelFactory interface {
Create(ctx context.Context, subscriber fhir.Identifier) (Channel, error)
}
ChannelFactory defines an interface for creating Subscription Notification Channels (e.g. rest-hook). A notification channel is the transport that is used to deliver a Subscription Notification to a subscriber.
type CsdChannelFactory ¶
CsdChannelFactory is a ChannelFactory that creates subscription notification channels based on the CSD directory. In other words, it looks up the subscriber endpoint in an external registry, the CSD. This is typically for out-of-band server-managed FHIR subscriptions.
func (CsdChannelFactory) Create ¶
func (c CsdChannelFactory) Create(ctx context.Context, subscriber fhir.Identifier) (Channel, error)
type InProcessChannelFactory ¶
type InProcessChannelFactory struct {
Profile profile.Provider
DefaultChannelFactory ChannelFactory
}
InProcessChannelFactory is a ChannelFactory that creates subscription notification channels on the following order of preference: - InProcessPubSubChannel: if the subscriber is in the same process (if the target CPC also runs this CPS). - DefaultChannelFactory: use this ChannelFactory otherwise.
func (InProcessChannelFactory) Create ¶
func (d InProcessChannelFactory) Create(ctx context.Context, subscriber fhir.Identifier) (Channel, error)
type InProcessPubSubChannel ¶
type InProcessPubSubChannel struct {
// contains filtered or unexported fields
}
func (InProcessPubSubChannel) Notify ¶
func (i InProcessPubSubChannel) Notify(ctx context.Context, notification coolfhir.SubscriptionNotification) error
type MockChannel ¶
type MockChannel struct {
// contains filtered or unexported fields
}
MockChannel is a mock of Channel interface.
func NewMockChannel ¶
func NewMockChannel(ctrl *gomock.Controller) *MockChannel
NewMockChannel creates a new mock instance.
func (*MockChannel) EXPECT ¶
func (m *MockChannel) EXPECT() *MockChannelMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockChannel) Notify ¶
func (m *MockChannel) Notify(ctx context.Context, notification coolfhir.SubscriptionNotification) error
Notify mocks base method.
type MockChannelFactory ¶
type MockChannelFactory struct {
// contains filtered or unexported fields
}
MockChannelFactory is a mock of ChannelFactory interface.
func NewMockChannelFactory ¶
func NewMockChannelFactory(ctrl *gomock.Controller) *MockChannelFactory
NewMockChannelFactory creates a new mock instance.
func (*MockChannelFactory) Create ¶
func (m *MockChannelFactory) Create(ctx context.Context, subscriber fhir.Identifier) (Channel, error)
Create mocks base method.
func (*MockChannelFactory) EXPECT ¶
func (m *MockChannelFactory) EXPECT() *MockChannelFactoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockChannelFactoryMockRecorder ¶
type MockChannelFactoryMockRecorder struct {
// contains filtered or unexported fields
}
MockChannelFactoryMockRecorder is the mock recorder for MockChannelFactory.
type MockChannelMockRecorder ¶
type MockChannelMockRecorder struct {
// contains filtered or unexported fields
}
MockChannelMockRecorder is the mock recorder for MockChannel.
type MockManager ¶
type MockManager struct {
// contains filtered or unexported fields
}
MockManager is a mock of Manager interface.
func NewMockManager ¶
func NewMockManager(ctrl *gomock.Controller) *MockManager
NewMockManager creates a new mock instance.
func (*MockManager) EXPECT ¶
func (m *MockManager) EXPECT() *MockManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockManagerMockRecorder ¶
type MockManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockManagerMockRecorder is the mock recorder for MockManager.
type NotificationEvent ¶
type NotificationEvent struct {
Subscriber fhir.Identifier `json:"subscriber"`
Focus fhir.Reference `json:"focus"`
TenantID string `json:"tenant_id"`
}
type RestHookChannel ¶
type RestHookChannel struct {
Endpoint string
Client fhirclient.HttpRequestDoer
}
func (RestHookChannel) Notify ¶
func (r RestHookChannel) Notify(ctx context.Context, notification coolfhir.SubscriptionNotification) error
type RetryableManager ¶
type RetryableManager struct {
// contains filtered or unexported fields
}
RetryableManager is a Manager derives Subscriptions from the properties of FHIR resource that triggered the notification: - Task: it notifies the Task filler and owner - CareTeam: it notifies all participants TODO: It does not yet store the subscription notifications in the FHIR store, which is required to support monotonically increasing event numbers.
func NewManager ¶
func NewManager(cpsBaseURLFunc func(tenants.Properties) *url.URL, tenants tenants.Config, channels ChannelFactory, messageBroker messaging.Broker) (*RetryableManager, error)