service

package
v0.0.0-...-7705b48 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue interface {
	Start(s *Service)
	Close(s *Service)
	Push(s *Service, payload []byte) error
	Pull(s *Service, callback func([]byte) error) error
}

type QueueEngineKafka

type QueueEngineKafka struct{}

func (*QueueEngineKafka) Close

func (q *QueueEngineKafka) Close(s *Service)

func (*QueueEngineKafka) Pull

func (q *QueueEngineKafka) Pull(s *Service, callback func([]byte) error) error

func (*QueueEngineKafka) Push

func (q *QueueEngineKafka) Push(s *Service, payload []byte) (err error)

func (*QueueEngineKafka) Start

func (q *QueueEngineKafka) Start(s *Service)

type QueueEngineRabbitMq

type QueueEngineRabbitMq struct{}

func (*QueueEngineRabbitMq) Close

func (q *QueueEngineRabbitMq) Close(s *Service)

func (*QueueEngineRabbitMq) Pull

func (q *QueueEngineRabbitMq) Pull(s *Service, callback func([]byte) error) error

func (*QueueEngineRabbitMq) Push

func (q *QueueEngineRabbitMq) Push(s *Service, payload []byte) error

func (*QueueEngineRabbitMq) Start

func (q *QueueEngineRabbitMq) Start(s *Service)

type Service

type Service struct {
	DB *dao.Dao
	// 消息驱动配置
	RabbitMQ           *xrabbitmq.AMQP
	KafkaEmailConsumer *xkafka.Consumer
	KafkaEmailProducer *xkafka.Producer
	// contains filtered or unexported fields
}

func New

func New(cfg *bo.Config, serviceType int) *Service

func (*Service) Close

func (s *Service) Close()

func (*Service) DoMessagePull

func (s *Service) DoMessagePull() error

func (*Service) DoMessagePush

func (s *Service) DoMessagePush(smtp *bo.Smtp) error

func (*Service) GetEmailQueue

func (s *Service) GetEmailQueue() (q Queue)

*

  • 简单工厂 *
  • @return Queue

func (*Service) SmtpDeleteAttachmentList

func (s *Service) SmtpDeleteAttachmentList(smtp *bo.Smtp)

func (*Service) SmtpGetAttachmentList

func (s *Service) SmtpGetAttachmentList(smtp *bo.Smtp) map[string]string

func (*Service) SmtpSend

func (s *Service) SmtpSend(smtp *bo.Smtp) (err error)

func (*Service) Start

func (s *Service) Start()

func (*Service) UploadCheckFile

func (s *Service) UploadCheckFile(filePath string) bool

func (*Service) UploadCreateTmpFile

func (s *Service) UploadCreateTmpFile() (string, string)

func (*Service) UploadDeleteTmpFile

func (s *Service) UploadDeleteTmpFile(name string)

func (*Service) UploadGetTmpFilePath

func (s *Service) UploadGetTmpFilePath(name string) string

func (*Service) UploadGetUploadDir

func (s *Service) UploadGetUploadDir() string

Jump to

Keyboard shortcuts

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