xmppparser

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMode treats incoming elements as provided from raw byte reader.
	DefaultMode = ParsingMode(iota)

	// SocketStream treats incoming elements as provided from a socket transport.
	SocketStream
)

Variables

View Source
var ErrNoElement = errors.New("parser: no elements")

ErrNoElement will be returned by Parse when no elements are available to be parsed in the reader buffer stream.

View Source
var ErrStreamClosedByPeer = errors.New("parser: stream closed by peer")

ErrStreamClosedByPeer will be returned by Parse when stream closed element is parsed.

View Source
var ErrTooLargeStanza = errors.New("parser: too large stanza")

ErrTooLargeStanza will be returned Parse when the size of the incoming stanza is too large.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses arbitrary XML input and builds an array with the structure of all tag and data elements.

func New

func New(reader io.Reader, mode ParsingMode, maxStanzaSize int) *Parser

New creates an empty Parser instance.

func (*Parser) Parse

func (p *Parser) Parse() (stravaganza.Element, error)

Parse parses next available XML element from reader.

type ParsingMode

type ParsingMode int

ParsingMode defines the way in which special parsed element should be considered or not according to the reader nature.

Jump to

Keyboard shortcuts

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