client

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCaptcha = errors.New("failure when trying to access content: a CAPTCHA is probably activated, look to the web interface")

Functions

This section is empty.

Types

type Client

type Client[M MailDoc] struct {
	// contains filtered or unexported fields
}

Client provides a high level interface to abstract yopmail data fetching

func New

func New[M MailDoc](enableDebugMode bool) (Client[M], error)

New creates a new client

func (Client[M]) DeleteMail

func (c Client[M]) DeleteMail(identifier string, mailID string) error

DeleteMail removes an email from yopmail inbox

func (Client[M]) FlushMail

func (c Client[M]) FlushMail(identifier string, mailID string) error

FlushMail removes all yopmail inbox mails

func (Client[M]) GetMailPage

func (c Client[M]) GetMailPage(identifier string, mailID string) (doc M, err error)

GetMailPage fetches html page containing the email

func (Client[M]) GetMailsPage

func (c Client[M]) GetMailsPage(identifier string, page int) (*goquery.Document, error)

GetMailsPage fetches all html pages containing emails data

type MailDoc

type MailDoc interface {
	MailHTMLDoc | MailSourceDoc | MailTextDoc
	Find(selector string) *goquery.Selection
}

type MailHTMLDoc

type MailHTMLDoc goquery.Document

type MailSourceDoc

type MailSourceDoc goquery.Document

type MailTextDoc

type MailTextDoc goquery.Document

Jump to

Keyboard shortcuts

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