message

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func TrackInbound added in v1.1.0

func TrackInbound(instanceID, chatJID, messageID, senderJID string)

TrackInbound stores the last inbound message ID for a given chat. Called by the event handler when a message is received. The Send function uses this to auto-mark messages as read before sending.

Types

type ContactEntry added in v1.1.0

type ContactEntry struct {
	DisplayName string `json:"displayName"`
	Vcard       string `json:"vcard"`
}

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
	MarkReadMessageID string
	MarkReadSender    string
	DisplayName       string
	Vcard             string
	Contacts          []ContactEntry
}

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, eventLogRepo storage.EventLogRepository, 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