message

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPayload       = errors.New("payload inválido")
	ErrInstanceNotConnected = errors.New("instância não conectada")
	ErrInvalidJID           = errors.New("JID inválido")
	ErrUnsupportedMediaType = errors.New("tipo de mídia não suportado")
	ErrSessionUnavailable   = errors.New("sessão indisponível")
)

Functions

This section is empty.

Types

type EnqueueInput

type EnqueueInput struct {
	InstanceID string
	To         string
	Type       string
	Payload    string
}

type OutboxWorker added in v1.0.10

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

func NewOutboxWorker added in v1.0.10

func NewOutboxWorker(service *Service, q queue.Queue, log *zap.Logger, numWorkers int) *OutboxWorker

func (*OutboxWorker) Start added in v1.0.10

func (w *OutboxWorker) Start(ctx context.Context)

func (*OutboxWorker) Stop added in v1.0.10

func (w *OutboxWorker) Stop()

type SendInput

type SendInput struct {
	InstanceID    string
	To            string
	Type          string
	Text          string
	MediaData     []byte
	MediaType     string
	Caption       string
	FileName      string
	Seconds       int
	PTT           bool
	MessageID     string
	Quoted        string
	Participant   string
	MentionedJids []string
}

type Service

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

func NewServiceWithSession

func NewServiceWithSession(repo storage.MessageRepository, sessionMgr SessionManager, instanceRepo storage.InstanceRepository, contactRepo storage.ContactRepository, q queue.Queue, cfg config.WhatsAppConfig, log *zap.Logger) *Service

func (*Service) Enqueue

func (s *Service) Enqueue(ctx context.Context, input EnqueueInput) (model.Message, error)

func (*Service) List

func (s *Service) List(ctx context.Context, instanceID string) ([]model.Message, error)

func (*Service) ResolveJID added in v1.0.11

func (s *Service) ResolveJID(ctx context.Context, client *whatsmeow.Client, phone string) (types.JID, error)

func (*Service) Send

func (s *Service) Send(ctx context.Context, input SendInput) (model.Message, error)

type SessionManager

type SessionManager interface {
	GetClient(instanceID string) (*whatsmeow.Client, error)
	IsSessionReady(instanceID string) bool
	HasSession(instanceID string, jid types.JID) (bool, error)
	GetPreKeyCount(instanceID string) (int, error)
	GetConnectedAt(instanceID string) time.Time
}

Jump to

Keyboard shortcuts

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