rostermodel

package
v0.0.0-...-aeec266 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscriptionNone   = "none"
	SubscriptionFrom   = "from"
	SubscriptionTo     = "to"
	SubscriptionBoth   = "both"
	SubscriptionRemove = "remove"
)

roster item subscription values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Username     string
	JID          string
	Name         string
	Subscription string
	Ask          bool
	Ver          int
	Groups       []string
}

Item represents a roster item storage entity.

func NewItem

func NewItem(elem xmpp.XElement) (*Item, error)

NewItem parses an XML element returning a derived roster item instance.

func (*Item) ContactJID

func (ri *Item) ContactJID() *jid.JID

ContactJID parses and returns roster item contact JID.

func (*Item) Element

func (ri *Item) Element() xmpp.XElement

Element returns a roster item XML element representation.

func (*Item) FromBytes

func (ri *Item) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a RosterItem entity from its binary representation.

func (*Item) ToBytes

func (ri *Item) ToBytes(buf *bytes.Buffer) error

ToBytes converts a RosterItem entity to its binary representation.

type Notification

type Notification struct {
	Contact  string
	JID      string
	Presence *xmpp.Presence
}

Notification represents a roster subscription pending notification.

func (*Notification) FromBytes

func (rn *Notification) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a Notification entity from its binary representation.

func (*Notification) ToBytes

func (rn *Notification) ToBytes(buf *bytes.Buffer) error

ToBytes converts a Notification entity to its binary representation.

type Version

type Version struct {
	Ver         int
	DeletionVer int
}

Version represents a roster version info.

func (*Version) FromBytes

func (rv *Version) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a Version from its binary representation.

func (*Version) ToBytes

func (rv *Version) ToBytes(buf *bytes.Buffer) error

ToBytes converts a Version entity to its binary representation.

Jump to

Keyboard shortcuts

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