smtp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SourceType = "smtp"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// SMTP server host
	Host string `yaml:"host" default:"localhost"`
	// SMTP server port
	Port int `yaml:"port" default:"587"`
	// Username for SMTP authentication
	Username string `yaml:"username"`
	// Password for SMTP authentication
	Password string `yaml:"password"`
	// From email address
	From string `yaml:"from"`
	// To email addresses
	To []string `yaml:"to"`
	// Whether to use TLS
	TLS bool `yaml:"tls" default:"false"`
	// Whether to skip TLS certificate verification
	InsecureSkipVerify bool `yaml:"insecureSkipVerify" default:"false"`
}

Config represents the configuration for the email source

func (*Config) SetDefaults

func (c *Config) SetDefaults() error

SetDefaults sets the default values for the config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the config

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func GetMetricsInstance

func GetMetricsInstance(namespace, monitor string) *Metrics

func (Metrics) IncErrors

func (m Metrics) IncErrors(group, source, sourceType, errorType string)

func (Metrics) IncMessagesPublished

func (m Metrics) IncMessagesPublished(group, source, sourceType string)

type SMTP

type SMTP struct {
	// contains filtered or unexported fields
}

func NewSMTP

func NewSMTP(ctx context.Context, log logrus.FieldLogger, monitor, name string, docs *string, includeMonitorName, includeGroupName bool, config *Config) (*SMTP, error)

func (*SMTP) GetConfig

func (s *SMTP) GetConfig() *Config

func (*SMTP) GetName

func (s *SMTP) GetName() string

func (*SMTP) GetType

func (s *SMTP) GetType() string

func (*SMTP) Publish

func (s *SMTP) Publish(ctx context.Context, evt event.Event) error

func (*SMTP) Start

func (s *SMTP) Start(ctx context.Context) error

func (*SMTP) Stop

func (s *SMTP) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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