gluon

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 14 Imported by: 0

README

Gluon

An IMAP4rev1 library focussing on correctness, stability and performance.

CI Status GoDoc Go Report Card License

Documentation

Overview

Package gluon implements an IMAP4rev1 (+ extensions) mailserver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option represents a type that can be used to configure the server.

func WithDelimiter

func WithDelimiter(delimiter string) Option

WithDelimiter instructs the server to use the given path delimiter instead of the default ('/').

func WithLogger

func WithLogger(in, out io.Writer) Option

WithLogger instructs the server to write incoming and outgoing IMAP communication to the given io.Writers.

func WithTLS

func WithTLS(cfg *tls.Config) Option

WithTLS instructs the server to use the given TLS config.

type Server

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

Server is the gluon IMAP server.

func New

func New(dir string, withOpt ...Option) *Server

New creates a new server with the given options. It stores data in the given directory.

func (*Server) AddUser

func (s *Server) AddUser(userID, username, password string, conn connector.Connector, store store.Store, driver, source string) error

AddUser makes a user available to the mailserver.

func (*Server) AddWatcher

func (s *Server) AddWatcher() chan events.Event

AddWatcher adds a new watcher.

func (*Server) Close

func (s *Server) Close(ctx context.Context) error

Close closes the server. It firstly closes all TCP listeners then closes the backend.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, l net.Listener) chan error

Serve serves connections accepted from the given listener. It returns a channel of all errors which occur while serving. The error channel is closed when either the connection is dropped or the server is closed.

Directories

Path Synopsis
Package connector defines the type that connects the server to a remote.
Package connector defines the type that connects the server to a remote.
mock_connector
Package mock_connector is a generated GoMock package.
Package mock_connector is a generated GoMock package.
internal
liner
Package liner handles reading lines from clients that may or may not require continuation.
Package liner handles reading lines from clients that may or may not require continuation.
pchan
Package pchan implements an async buffered priority channel.
Package pchan implements an async buffered priority channel.
remote/mock_remote
Package mock_remote is a generated GoMock package.
Package mock_remote is a generated GoMock package.
response
Package response implements types used when sending IMAP responses back to clients.
Package response implements types used when sending IMAP responses back to clients.
session
Package session handles IMAP commands received from clients within a single IMAP session (one client connection).
Package session handles IMAP commands received from clients within a single IMAP session (one client connection).
Package rfc822 implements methods for handling RFC822 messages.
Package rfc822 implements methods for handling RFC822 messages.
package store implements types that store message literals.
package store implements types that store message literals.
mock_store
Package mock_store is a generated GoMock package.
Package mock_store is a generated GoMock package.

Jump to

Keyboard shortcuts

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