Documentation ¶
Index ¶
- Constants
- type Disco
- func (d *Disco) AccountFeatures(_ context.Context) ([]string, error)
- func (d *Disco) AccountProvider() InfoProvider
- func (d *Disco) MatchesNamespace(namespace string, _ bool) bool
- func (d *Disco) Name() string
- func (d *Disco) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error
- func (d *Disco) ServerFeatures(_ context.Context) ([]string, error)
- func (d *Disco) ServerProvider() InfoProvider
- func (d *Disco) SetModules(mods []module.Module)
- func (d *Disco) Start(_ context.Context) error
- func (d *Disco) Stop(_ context.Context) error
- func (d *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 ¶ added in v0.52.2
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 *c2s.ResourceManager, ) *Disco
New returns a new initialized disco module instance.
func (*Disco) AccountFeatures ¶ added in v0.52.2
AccountFeatures returns account disco features.
func (*Disco) AccountProvider ¶ added in v0.52.2
func (d *Disco) AccountProvider() InfoProvider
AccountProvider returns current disco info account provider.
func (*Disco) MatchesNamespace ¶ added in v0.52.2
MatchesNamespace tells whether namespace matches disco module.
func (*Disco) ServerFeatures ¶ added in v0.52.2
ServerFeatures returns server disco features.
func (*Disco) ServerProvider ¶ added in v0.52.2
func (d *Disco) ServerProvider() InfoProvider
ServerProvider returns current disco info server provider.
func (*Disco) SetModules ¶ added in v0.52.2
SetModules set disco modules to be announced on info request.
type InfoProvider ¶ added in v0.3.3
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.