Versions in this module Expand all Collapse all v0 v0.0.3 Nov 6, 2022 v0.0.2 Nov 4, 2022 Changes in this version + var ErrInvalidJIDType = errors.New("invalid JID type") + var ErrInvalidNode = errors.New("invalid node") + var ErrInvalidToken = errors.New("invalid token with tag") + var ErrInvalidType = errors.New("unsupported payload type") + var ErrNonStringKey = errors.New("non-string key") + var IndentXML = false + var MaxBytesToPrintAsHex = 128 + func Marshal(n Node) ([]byte, error) + func Unpack(data []byte) ([]byte, error) + type AttrUtility struct + Attrs Attrs + Errors []error + func (au *AttrUtility) Bool(key string) bool + func (au *AttrUtility) Error() error + func (au *AttrUtility) GetBool(key string, require bool) (bool, bool) + func (au *AttrUtility) GetInt64(key string, require bool) (int64, bool) + func (au *AttrUtility) GetJID(key string, require bool) (jidVal types.JID, ok bool) + func (au *AttrUtility) GetString(key string, require bool) (strVal string, ok bool) + func (au *AttrUtility) GetUint64(key string, require bool) (uint64, bool) + func (au *AttrUtility) GetUnixTime(key string, require bool) (time.Time, bool) + func (au *AttrUtility) Int(key string) int + func (au *AttrUtility) Int64(key string) int64 + func (au *AttrUtility) JID(key string) types.JID + func (au *AttrUtility) OK() bool + func (au *AttrUtility) OptionalBool(key string) bool + func (au *AttrUtility) OptionalInt(key string) int + func (au *AttrUtility) OptionalJID(key string) *types.JID + func (au *AttrUtility) OptionalJIDOrEmpty(key string) types.JID + func (au *AttrUtility) OptionalString(key string) string + func (au *AttrUtility) OptionalUnixTime(key string) time.Time + func (au *AttrUtility) String(key string) string + func (au *AttrUtility) Uint64(key string) uint64 + func (au *AttrUtility) UnixTime(key string) time.Time + type Attrs = map[string]interface + type ErrorList []error + func (el ErrorList) Error() string + type Node struct + Attrs Attrs + Content interface{} + Tag string + func Unmarshal(data []byte) (*Node, error) + func (n *Node) AttrGetter() *AttrUtility + func (n *Node) GetChildByTag(tags ...string) Node + func (n *Node) GetChildren() []Node + func (n *Node) GetChildrenByTag(tag string) (children []Node) + func (n *Node) GetOptionalChildByTag(tags ...string) (val Node, ok bool) + func (n *Node) XMLString() string