Documentation ¶
Index ¶
- Constants
- func ExtractReceivedArchiveID(ctx context.Context) string
- func ExtractSentArchiveID(ctx context.Context) string
- func IsArchiveRequested(inf c2smodel.Info) bool
- func IsMessageArchievable(msg *stravaganza.Message) bool
- type Config
- type Mam
- func (m *Mam) AccountFeatures(_ context.Context) ([]string, error)
- func (m *Mam) MatchesNamespace(namespace string, serverTarget bool) bool
- func (m *Mam) Name() string
- func (m *Mam) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error
- func (m *Mam) ServerFeatures(_ context.Context) ([]string, error)
- func (m *Mam) Start(_ context.Context) error
- func (m *Mam) Stop(_ context.Context) error
- func (m *Mam) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)
- type Service
Constants ¶
const ( // ModuleName represents mam module name. ModuleName = "mam" // XEPNumber represents mam XEP number. XEPNumber = "0313" )
Variables ¶
This section is empty.
Functions ¶
func ExtractReceivedArchiveID ¶
ExtractReceivedArchiveID returns message received archive ID by inspecting the passed context.
func ExtractSentArchiveID ¶
ExtractSentArchiveID returns message sent archive ID by inspecting the passed context.
func IsArchiveRequested ¶
IsArchiveRequested determines whether archive has been requested over a C2S stream by inspecting inf parameter.
func IsMessageArchievable ¶ added in v0.62.3
func IsMessageArchievable(msg *stravaganza.Message) bool
IsMessageArchievable returns true if the message is archievable.
Types ¶
type Config ¶
type Config struct { // QueueSize defines maximum number of archive messages stanzas. // When the limit is reached, the oldest message will be purged to make room for the new one. QueueSize int `fig:"queue_size" default:"1000"` }
Config contains mam module configuration options.
type Mam ¶
type Mam struct {
// contains filtered or unexported fields
}
Mam represents a mam (XEP-0313) module type.
func New ¶
func New( cfg Config, router router.Router, hosts *host.Hosts, rep repository.Repository, hk *hook.Hooks, logger kitlog.Logger, ) *Mam
New returns a new initialized mam instance.
func (*Mam) AccountFeatures ¶
AccountFeatures returns mam account disco features.
func (*Mam) MatchesNamespace ¶
MatchesNamespace tells whether namespace matches mam module.
func (*Mam) ServerFeatures ¶
ServerFeatures returns mam server disco features.
func (*Mam) StreamFeature ¶
StreamFeature returns mam module stream feature.
type Service ¶ added in v0.63.0
type Service struct {
// contains filtered or unexported fields
}
Service represents a MAM service.
func NewService ¶ added in v0.63.0
func NewService( router router.Router, hk *hook.Hooks, rep repository.Repository, maxQueueSize int, logger kitlog.Logger, ) *Service
NewService returns a new archive service instance.
func (*Service) ArchiveMessage ¶ added in v0.63.0
func (m *Service) ArchiveMessage(ctx context.Context, message *stravaganza.Message, archiveID, id string) error
ArchiveMessage archives a message.
func (*Service) DeleteArchive ¶ added in v0.63.0
DeleteArchive deletes an archive.