pubsubmodel

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Owner     = "owner"
	Member    = "member"
	Publisher = "publisher"
	Outcast   = "outcast"
)

affiliation definitions.

View Source
const (
	None       = "none"
	Subscribed = "subscribed"
)

subscription definitions.

View Source
const (
	// Open represents 'open' access model.
	Open = "open"

	// Presence represents 'presence' access model.
	Presence = "presence"

	// Roster represents 'roster' access model.
	Roster = "roster"

	// WhiteList represents 'whitelist' access model.
	WhiteList = "whitelist"

	// Never represents 'never' send last published item option.
	Never = "never"

	// OnSub represents 'on_sub' send last published item option.
	OnSub = "on_sub"

	// OnSubAndPresence represents 'on_sub_and_presence' send last published item option.
	OnSubAndPresence = "on_sub_and_presence"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Affiliation

type Affiliation struct {
	JID         string
	Affiliation string
}

Affiliation represents a pubsub affiliation.

func (*Affiliation) FromBytes

func (a *Affiliation) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a Affiliation entity from its binary representation.

func (*Affiliation) ToBytes

func (a *Affiliation) ToBytes(buf *bytes.Buffer) error

ToBytes converts a Affiliation entity to its binary representation.

type Item

type Item struct {
	ID        string
	Publisher string
	Payload   xmpp.XElement
}

Item represents a pubsub node item.

func (*Item) FromBytes

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

FromBytes deserializes a Item entity from its binary representation.

func (*Item) ToBytes

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

ToBytes converts a Item entity to its binary representation.

type Node

type Node struct {
	Host    string
	Name    string
	Options Options
}

Node represents a pubsub node.

func (*Node) FromBytes

func (n *Node) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a Node entity from its binary representation.

func (*Node) ToBytes

func (n *Node) ToBytes(buf *bytes.Buffer) error

ToBytes converts a Node entity to its binary representation.

type Options

type Options struct {
	Title                 string
	DeliverNotifications  bool
	DeliverPayloads       bool
	PersistItems          bool
	MaxItems              int64
	AccessModel           string
	SendLastPublishedItem string
	RosterGroupsAllowed   []string
	NotificationType      string
	NotifyConfig          bool
	NotifyDelete          bool
	NotifySub             bool
}

Options represents pubsub node configuration options.

func NewOptionsFromMap

func NewOptionsFromMap(m map[string]string) (*Options, error)

NewOptionsFromMap returns a new node Options instance derived from an input map.

func NewOptionsFromSubmitForm

func NewOptionsFromSubmitForm(form *xep0004.DataForm) (*Options, error)

NewOptionsFromSubmitForm returns a new node Options instance derived from a submit form.

func (*Options) Form

func (opt *Options) Form(rosterGroups []string) *xep0004.DataForm

Form returns Options form representation.

func (*Options) Map

func (opt *Options) Map() (map[string]string, error)

Map returns Options map representation.

func (*Options) ResultForm

func (opt *Options) ResultForm() *xep0004.DataForm

ResultForm returns Options result form representation.

type Subscription

type Subscription struct {
	SubID        string
	JID          string
	Subscription string
}

Subscription represents a pubsub node subscription.

func (*Subscription) FromBytes

func (s *Subscription) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a Subscription entity from its binary representation.

func (*Subscription) ToBytes

func (s *Subscription) ToBytes(buf *bytes.Buffer) error

ToBytes converts a Subscription entity to its binary representation.

Jump to

Keyboard shortcuts

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