Documentation ¶
Index ¶
- func RegisterPublisher(name string, p Publisher)
- type Config
- type DefaultNotificationPublisher
- func (p *DefaultNotificationPublisher) Configure(config *Config) (bool, error)
- func (p *DefaultNotificationPublisher) PublishCommit(event *types.CommitNotification) error
- func (p *DefaultNotificationPublisher) Publishers() map[string]Publisher
- func (p *DefaultNotificationPublisher) UnregisterPublisher(name string)
- type Publisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPublisher ¶
RegisterPublisher makes a Sender available by the provided name.
If called twice with the same name, the name is blank, or if the provided Sender is nil, this function panics.
Types ¶
type DefaultNotificationPublisher ¶
type DefaultNotificationPublisher struct {
// contains filtered or unexported fields
}
DefaultNotificationPublisher - default notification publisher, manages configuration
func (*DefaultNotificationPublisher) Configure ¶
func (p *DefaultNotificationPublisher) Configure(config *Config) (bool, error)
Configure - configure is used to register multiple notification publishers
func (*DefaultNotificationPublisher) PublishCommit ¶
func (p *DefaultNotificationPublisher) PublishCommit(event *types.CommitNotification) error
Send - send notifications through all configured publishers
func (*DefaultNotificationPublisher) Publishers ¶
func (p *DefaultNotificationPublisher) Publishers() map[string]Publisher
Publishers returns the list of the registered Publishers.
func (*DefaultNotificationPublisher) UnregisterPublisher ¶
func (p *DefaultNotificationPublisher) UnregisterPublisher(name string)
UnregisterPublisher removes a publisher with a particular name from the list.
type Publisher ¶
type Publisher interface { // Configure attempts to initialize the notifier with the provided configuration. // It returns whether the notifier is enabled or not. Configure(*Config) (bool, error) // PublishCommit informs the existence of the specified notification. PublishCommit(event *types.CommitNotification) error }
Publisher represents anything that can transmit notifications.
Click to show internal directories.
Click to hide internal directories.