Icinga / icinga-notifications

Icinga Notifications: new and improved notifications and incident management for Icinga (work in progress, not ready for production yet)
GNU General Public License v2.0
11 stars 0 forks source link

Channels: Rework default ConfigOptions and reorder methods #242

Closed oxzi closed 4 months ago

oxzi commented 4 months ago
channels: Mark Required ConfigOptions

Each plugin.ConfigOption was revisited and potentially being marked as
Required, which was missing at some. Furthermore, the order of the
fields was changed to match the struct field order of ConfigOption.

channels: Reorder methods according to plugin.Plugin

The plugin.Plugin interface specifies the three methods required for the
channel plugin RPC API in their logical order. Considering that these
channels are the blueprint for external channel development, the order
of implementing channel plugins was changed to correspond to the
interface.

For all files, the main function has been moved to the top.

In addition, the Email.Send method received a documentation string
indicating that it implements the enmime.Sender interface, as it is not
directly called anywhere. Further, the Email.GetServer method got
inlined as it was only called from one other method.

Closes #240.

yhabteab commented 4 months ago

For all files, the main function has been placed at the bottom.

I wouldn't do that, IMHAO the main function should be at the top, before the other stuff.

oxzi commented 4 months ago

For all files, the main function has been placed at the bottom.

I wouldn't do that, IMHAO the main function should be at the top, before the other stuff.

Honestly, I don't mind. It just should be at the same position.

If it's at the top, it should be before the struct type definition, as otherwise the main function appears between the type definition and its methods.