xep0059

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RSMNamespace specifies XEP-0059 namespace constant value.
	RSMNamespace = "http://jabber.org/protocol/rsm"
)

Variables

View Source
var (
	// ErrPageNotFound will be returned by GetResultSetPage when page request cannot be satisfied.
	ErrPageNotFound = errors.New("page not found")
)

Functions

This section is empty.

Types

type Request

type Request struct {
	After    string
	Before   string
	Index    int
	Max      int
	LastPage bool
}

Request represents a rsm request value.

func NewRequestFromElement

func NewRequestFromElement(elem stravaganza.Element) (*Request, error)

NewRequestFromElement returns a Request derived from an XML element.

type Result

type Result struct {
	Index    int
	First    string
	Last     string
	Count    int
	Complete bool
}

Result represents a rsm result value.

func GetResultSetPage

func GetResultSetPage[T any](rs []T, req *Request, getID func(i T) string) ([]T, *Result, error)

GetResultSetPage returns result page based on the passed request.

func (*Result) Element

func (r *Result) Element() stravaganza.Element

Element returns XML representation of a Result instance.

Jump to

Keyboard shortcuts

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