github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/notification/builder.go (about)

     1  package notification
     2  
     3  type (
     4  	BundleBuilder interface {
     5  		NewBundle(identifier string, notificationParams NotificationParams) (Bundle, error)
     6  	}
     7  
     8  	Bundle interface {
     9  		CreateNotificationEvent() error
    10  		UpdateNotificationEvent() error
    11  		CancelNotificationEvent() error
    12  	}
    13  )
    14  
    15  type Builder struct {
    16  	notificationClient NotificationClient
    17  	config             Config
    18  }
    19  
    20  func NewBundleBuilder(notificationClient NotificationClient, config Config) BundleBuilder {
    21  	return &Builder{
    22  		notificationClient: notificationClient,
    23  		config:             config,
    24  	}
    25  }
    26  
    27  func (b *Builder) NewBundle(identifier string, notificationParams NotificationParams) (Bundle, error) {
    28  	return NewNotificationBundle(identifier, notificationParams, b.notificationClient, b.config), nil
    29  }