sendunit

package
v0.0.0-...-1d4ee7a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SendUnitPool sync.Map

Functions

This section is empty.

Types

type EmailSend

type EmailSend struct {
	SendInfo      *sys_entity.CoSend
	SendList      chan *sys_entity.CoSendList
	SendListModel *[]sys_entity.CoSendList
	Message       *sys_entity.CoMessage
	MaxGo         int //协程数量
	Response      chan *EmailSendResponse
	WithGroup     sync.WaitGroup
	Ctx           context.Context
	SmtpServer    sys_entity.CoSmtpServer
	Dispatch      dispatch2.EmailDispatcher
	Signal        *list.List
	SignalLock    sync.RWMutex
	SignPool      []*SignalCmd
	HaveSignalCmd chan int8
	Status        int8
	StatusLock    sync.RWMutex
}

func GetSendEmailUnitPool

func GetSendEmailUnitPool(key string) (res *EmailSend, have bool)

func (*EmailSend) AddSendList

func (e *EmailSend) AddSendList(sendList *sys_entity.CoSendList)

func (*EmailSend) Close

func (e *EmailSend) Close()

func (*EmailSend) Init

func (e *EmailSend) Init(maxGo int, sendInfo *sys_entity.CoSend, sendList *[]sys_entity.CoSendList, ctx context.Context)

func (*EmailSend) Pause

func (e *EmailSend) Pause()

func (*EmailSend) Send

func (e *EmailSend) Send(send *sys_entity.CoSendList, smtpserver *sys_entity.CoSmtpServer) (err error)

func (*EmailSend) Start

func (e *EmailSend) Start()

func (*EmailSend) StartSend

func (e *EmailSend) StartSend(signalCmd *SignalCmd, goIndex int)

func (*EmailSend) Stop

func (e *EmailSend) Stop()

type EmailSendResponse

type EmailSendResponse struct {
	Code int
}

type SendUniter

type SendUniter interface {
	AddSendList(*sys_entity.CoSendList)
	Init(int, *sys_entity.CoSend, *[]sys_entity.CoSendList, context.Context)
	Stop()
	Pause()
	Start()
}

func SendFactory

func SendFactory(unitType int) SendUniter

type SignalCmd

type SignalCmd struct {
	WithGroup *sync.WaitGroup
	Signal    chan int8
}

Jump to

Keyboard shortcuts

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