Documentation ¶
Index ¶
- Constants
- type Disco
- func (m *Disco) AccountFeatures(_ context.Context) ([]string, error)
- func (m *Disco) AccountProvider() InfoProvider
- func (m *Disco) MatchesNamespace(namespace string, _ bool) bool
- func (m *Disco) Name() string
- func (m *Disco) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error
- func (m *Disco) ServerFeatures(_ context.Context) ([]string, error)
- func (m *Disco) ServerProvider() InfoProvider
- func (m *Disco) Start(_ context.Context) error
- func (m *Disco) Stop(_ context.Context) error
- func (m *Disco) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)
- type InfoProvider
Constants ¶
View Source
const ( // ModuleName represents disco module name. ModuleName = "disco" // XEPNumber represents disco XEP number. XEPNumber = "0030" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Disco ¶
type Disco struct {
// contains filtered or unexported fields
}
Disco represents a disco info (XEP-0030) module type.
func New ¶
func New( router router.Router, components *component.Components, rosRep repository.Roster, resMng resourcemanager.Manager, hk *hook.Hooks, logger kitlog.Logger, ) *Disco
New returns a new initialized disco module instance.
func (*Disco) AccountFeatures ¶
AccountFeatures returns account disco features.
func (*Disco) AccountProvider ¶
func (m *Disco) AccountProvider() InfoProvider
AccountProvider returns current disco info account provider.
func (*Disco) MatchesNamespace ¶
MatchesNamespace tells whether namespace matches disco module.
func (*Disco) ServerFeatures ¶
ServerFeatures returns server disco features.
func (*Disco) ServerProvider ¶
func (m *Disco) ServerProvider() InfoProvider
ServerProvider returns current disco info server provider.
func (*Disco) StreamFeature ¶
StreamFeature returns disco stream feature.
type InfoProvider ¶
type InfoProvider interface { // Identities returns all identities associated to the provider. Identities(ctx context.Context, toJID, fromJID *jid.JID, node string) []discomodel.Identity // Items returns all items associated to the provider. Items(ctx context.Context, toJID, fromJID *jid.JID, node string) ([]discomodel.Item, error) // Features returns all features associated to the provider. Features(ctx context.Context, toJID, fromJID *jid.JID, node string) ([]discomodel.Feature, error) // Forms returns data forms associated to the provider. Forms(ctx context.Context, toJID, fromJID *jid.JID, node string) ([]xep0004.DataForm, error) }
InfoProvider represents a general entity disco info provider interface.
Click to show internal directories.
Click to hide internal directories.