sendxmpp

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package sendxmpp facilitates integration testing with sendxmpp.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile(cfg Config) integration.Option

ConfigFile is an option that can be used to write a temporary sendxmpp config file. This will overwrite the existing config file and make most of the other options in this package noops. This option only exists for the rare occasion that you need complete control over the config file.

func Debug

func Debug() integration.Option

Debug enables debug logging for sendxmpp (logging must still be enabled using integration.Log). Using it multiple times increases the log level.

func New

func New(ctx context.Context, opts ...integration.Option) (*integration.Cmd, error)

New creates a new, unstarted, sendxmpp running as a daemon using interactive mode.

The provided context is used to kill the process (by calling os.Process.Kill) if the context becomes done before the command completes on its own.

func Ping

func Ping(cmd *integration.Cmd, to jid.JID) error

Ping sends an XMPP ping.

func Raw

func Raw() integration.Option

Raw configures sendxmpp to send raw XML instead of messages.

func Send

func Send(cmd *integration.Cmd, s string) error

Send transmits the given message (or xml, if the Raw option was used) over sendxmpp.

func TLS

func TLS() integration.Option

TLS configures sendxmpp to log in with TLS.

func Test

Test starts a sendxmpp instance and returns a function that runs subtests using t.Run. Multiple calls to the returned function will result in uniquely named subtests. When all subtests have completed, the daemon is stopped.

Types

type Config

type Config struct {
	JID       jid.JID
	Port      string
	Password  string
	Component string
}

Config contains options that can be written to a sendxmpp config file.

Jump to

Keyboard shortcuts

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