version

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: BSD-2-Clause Imports: 7 Imported by: 2

Documentation

Overview

Package version queries a remote entity for software version info.

Index

Constants

View Source
const (
	// NS is the XML namespace used by software version queries.
	// It is provided as a convenience.
	NS = "jabber:iq:version"
)

Variables

View Source
var (
	Feature = info.Feature{Var: NS}
)

A list of service discovery features that are supported by this package.

Functions

This section is empty.

Types

type Query

type Query struct {
	XMLName xml.Name `xml:"jabber:iq:version query"`
	Name    string   `xml:"name,omitempty"`
	Version string   `xml:"version,omitempty"`
	OS      string   `xml:"os,omitempty"`
}

Query is the payload of a software version query or response.

func Get

func Get(ctx context.Context, s *xmpp.Session, to jid.JID) (Query, error)

Get requests the software version of the provided entity. It blocks until a response is received.

func GetIQ

func GetIQ(ctx context.Context, iq stanza.IQ, s *xmpp.Session) (Query, error)

GetIQ is like Get but it allows you to customize the IQ. Changing the type of the provided IQ has no effect.

func (Query) TokenReader

func (q Query) TokenReader() xml.TokenReader

TokenReader implements xmlstream.Marshaler.

func (Query) WriteXML

func (q Query) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML implements xmlstream.WriterTo.

Jump to

Keyboard shortcuts

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