mail

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package mail provides a mail access layer

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidParameter = errors.New("invalid parameter")

ErrInvalidParameter is returned when a parameter is invalid

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when something is not found

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned when something is not implemented

Functions

func LoadFs

func LoadFs(access *confpar.Access) (afero.Fs, error)

LoadFs loads a file system from an access description

Types

type File

type File struct {
	Path    string
	Content []byte
	Fs      *Fs
	At      int64
}

File is the afero.File implementation

func (*File) Close

func (f *File) Close() error

Close closes the file transfer and does the mail sending

func (*File) Name

func (f *File) Name() string

Name of the file

func (*File) Read

func (f *File) Read(b []byte) (int, error)

Read stores the received file content into the local buffer

func (*File) ReadAt

func (f *File) ReadAt(_ []byte, _ int64) (int, error)

ReadAt is not implemented

func (*File) Readdir

func (f *File) Readdir(_ int) ([]os.FileInfo, error)

Readdir is not implemented

func (*File) Readdirnames

func (f *File) Readdirnames(_ int) ([]string, error)

Readdirnames is not implemented

func (*File) Seek

func (f *File) Seek(_ int64, _ int) (int64, error)

Seek is not implemented

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

Stat is not implemented

func (*File) Sync

func (f *File) Sync() error

Sync is not implemented

func (*File) Truncate

func (f *File) Truncate(_ int64) error

Truncate is not implemented

func (*File) Write

func (f *File) Write(b []byte) (int, error)

func (*File) WriteAt

func (f *File) WriteAt(b []byte, off int64) (int, error)

WriteAt is not implemented

func (*File) WriteString

func (f *File) WriteString(s string) (int, error)

WriteString is not implemented

type Fs

type Fs struct {
	Dialer  mail.Dialer
	From    string
	To      string
	Subject string
	Message string
}

Fs is a write-only afero.Fs implementation using mail as backend

func (*Fs) Chmod

func (m *Fs) Chmod(name string, mode os.FileMode) error

Chmod is not implemented

func (*Fs) Chown added in v0.9.0

func (m *Fs) Chown(string, int, int) error

Chown is not implemented

func (*Fs) Chtimes

func (m *Fs) Chtimes(name string, atime, mtime time.Time) error

Chtimes is not implemented

func (*Fs) Create

func (m *Fs) Create(name string) (afero.File, error)

Create creates a file buffer

func (*Fs) LstatIfPossible

func (m *Fs) LstatIfPossible(name string) (os.FileInfo, bool, error)

LstatIfPossible is not implemented

func (*Fs) Mkdir

func (m *Fs) Mkdir(name string, mode os.FileMode) error

Mkdir is not implemented

func (*Fs) MkdirAll

func (m *Fs) MkdirAll(name string, mode os.FileMode) error

MkdirAll is not implemented

func (*Fs) Name

func (m *Fs) Name() string

Name of the filesystem

func (*Fs) Open

func (m *Fs) Open(name string) (afero.File, error)

Open opens a file buffer

func (*Fs) OpenFile

func (m *Fs) OpenFile(name string, flag int, mode os.FileMode) (afero.File, error)

OpenFile opens a file buffer

func (*Fs) Remove

func (m *Fs) Remove(name string) error

Remove is not implemented

func (*Fs) RemoveAll

func (m *Fs) RemoveAll(name string) error

RemoveAll is not implemented

func (*Fs) Rename

func (m *Fs) Rename(name string, newname string) error

Rename is not implemented

func (*Fs) Stat

func (m *Fs) Stat(name string) (os.FileInfo, error)

Stat is not implemented

Jump to

Keyboard shortcuts

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