xep0215

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package xep0215 implements XEP-0215: External Service Discovery.

Index

Constants

View Source
const (
	// ModuleName represents external service discovery module name.
	ModuleName = "extdisco"

	// XEPNumber represents external service discovery XEP number.
	XEPNumber = "0215"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Services []ServiceConfig `fig:"services"`

	// SharedSecret is the HMAC shared secret for generating temporary TURN credentials.
	// When set, TURN services will return time-limited HMAC-SHA1 credentials instead of
	// static username/password. This implements RFC 5766 / XEP-0215 restricted credentials.
	SharedSecret string `fig:"shared_secret"`
}

Config contains external service discovery module configuration.

type ExtDisco

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

ExtDisco represents an external service discovery (XEP-0215) module type.

func New

func New(cfg Config, router router.Router, logger kitlog.Logger) *ExtDisco

New returns a new initialized ExtDisco instance.

func (*ExtDisco) AccountFeatures

func (x *ExtDisco) AccountFeatures(_ context.Context) ([]string, error)

AccountFeatures returns module account disco features.

func (*ExtDisco) MatchesNamespace

func (x *ExtDisco) MatchesNamespace(namespace string, serverTarget bool) bool

MatchesNamespace tells whether namespace matches this module.

func (*ExtDisco) Name

func (x *ExtDisco) Name() string

Name returns module name.

func (*ExtDisco) ProcessIQ

func (x *ExtDisco) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error

ProcessIQ processes an external service discovery iq.

func (*ExtDisco) ServerFeatures

func (x *ExtDisco) ServerFeatures(_ context.Context) ([]string, error)

ServerFeatures returns module server disco features.

func (*ExtDisco) Start

func (x *ExtDisco) Start(_ context.Context) error

Start starts the module.

func (*ExtDisco) Stop

func (x *ExtDisco) Stop(_ context.Context) error

Stop stops the module.

func (*ExtDisco) StreamFeature

func (x *ExtDisco) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)

StreamFeature returns module stream feature.

type ServiceConfig

type ServiceConfig struct {
	Host      string `fig:"host"`
	Port      int    `fig:"port"`
	Type      string `fig:"type"`      // "stun" or "turn"
	Transport string `fig:"transport"` // "udp" or "tcp"
	Username  string `fig:"username"`  // TURN credentials
	Password  string `fig:"password"`  // TURN credentials
}

ServiceConfig contains configuration for a single external service.

Jump to

Keyboard shortcuts

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