graphserver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

func NewGraphBackend

func NewGraphBackend(clientId, tenantId, secret string, opts ...BackendOption) (*Backend, error)

NewGraphBackend sets up a new server

func (*Backend) NewSession

func (b *Backend) NewSession(c *smtp.Conn) (smtp.Session, error)

NewSession is called after client greeting (EHLO, HELO).

type BackendOption

type BackendOption func(*Backend)

func WithAllowedSenders

func WithAllowedSenders(senders []string) BackendOption

func WithAllowedSources

func WithAllowedSources(sources []string) BackendOption

func WithLogger

func WithLogger(logger Logger) BackendOption

func WithPrometheusRegistry

func WithPrometheusRegistry(reg *prometheus.Registry) BackendOption

func WithSaveToSentItems

func WithSaveToSentItems(save bool) BackendOption

type Level

type Level int

Level represents a log level

const (
	LevelInfo  Level = 0
	LevelWarn  Level = 4
	LevelError Level = 8
)

Log level constants

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Error(msg string, args ...any)
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
}

Logger is a basic levelled logger

type Session

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

func (*Session) Data

func (s *Session) Data(r io.Reader) error

func (*Session) Logout

func (s *Session) Logout() error

func (*Session) Mail

func (s *Session) Mail(from string, opts *smtp.MailOptions) error

func (*Session) Rcpt

func (s *Session) Rcpt(to string, opts *smtp.RcptOptions) error

func (*Session) Reset

func (s *Session) Reset()

Jump to

Keyboard shortcuts

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