mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-15 00:15:10 +00:00
173 lines
4.6 KiB
Go
173 lines
4.6 KiB
Go
// Copyright 2022 Martin Dosch.
|
|
// Use of this source code is governed by the BSD-2-clause
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import "encoding/xml"
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type OxMessageElement struct {
|
|
XMLName xml.Name `xml:"message"`
|
|
Text string `xml:",chardata"`
|
|
To string `xml:"to,attr"`
|
|
Id string `xml:"id,attr"`
|
|
From string `xml:"from,attr"`
|
|
Openpgp struct {
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
} `xml:"openpgp"`
|
|
Encryption struct {
|
|
XMLName xml.Name `xml:"encryption"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Namespace string `xml:"namespace,attr"`
|
|
}
|
|
Body string `xml:"body"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type OxCryptElement struct {
|
|
XMLName xml.Name `xml:"signcrypt"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
To struct {
|
|
Text string `xml:",chardata"`
|
|
Jid string `xml:"jid,attr"`
|
|
} `xml:"to"`
|
|
Time struct {
|
|
Text string `xml:",chardata"`
|
|
Stamp string `xml:"stamp,attr"`
|
|
} `xml:"time"`
|
|
Rpad string `xml:"rpad"`
|
|
Payload struct {
|
|
Text string `xml:",chardata"`
|
|
Body struct {
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
} `xml:"body"`
|
|
} `xml:"payload"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type OxPublicKey struct {
|
|
XMLName xml.Name `xml:"pubsub"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Items struct {
|
|
Text string `xml:",chardata"`
|
|
Node string `xml:"node,attr"`
|
|
Item struct {
|
|
Text string `xml:",chardata"`
|
|
ID string `xml:"id,attr"`
|
|
Pubkey struct {
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Data string `xml:"data"`
|
|
} `xml:"pubkey"`
|
|
} `xml:"item"`
|
|
} `xml:"items"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type OxPublicKeysList struct {
|
|
XMLName xml.Name `xml:"pubsub"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Items struct {
|
|
Text string `xml:",chardata"`
|
|
Node string `xml:"node,attr"`
|
|
Item struct {
|
|
Text string `xml:",chardata"`
|
|
ID string `xml:"id,attr"`
|
|
PublicKeysList struct {
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
PubkeyMetadata []struct {
|
|
Text string `xml:",chardata"`
|
|
Date string `xml:"date,attr"`
|
|
V4Fingerprint string `xml:"v4-fingerprint,attr"`
|
|
} `xml:"pubkey-metadata"`
|
|
} `xml:"public-keys-list"`
|
|
} `xml:"item"`
|
|
} `xml:"items"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type IQPubsubRequest struct {
|
|
XMLName xml.Name `xml:"pubsub"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Items struct {
|
|
Text string `xml:",chardata"`
|
|
Node string `xml:"node,attr"`
|
|
MaxItems string `xml:"max_items,attr"`
|
|
} `xml:"items"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type IQDiscoItemsType struct {
|
|
XMLName xml.Name `xml:"query"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Item []struct {
|
|
Text string `xml:",chardata"`
|
|
Jid string `xml:"jid,attr"`
|
|
} `xml:"item"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type IQDiscoInfoType struct {
|
|
XMLName xml.Name `xml:"query"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Identity struct {
|
|
Text string `xml:",chardata"`
|
|
Type string `xml:"type,attr"`
|
|
Name string `xml:"name,attr"`
|
|
Category string `xml:"category,attr"`
|
|
} `xml:"identity"`
|
|
Feature []struct {
|
|
Text string `xml:",chardata"`
|
|
Var string `xml:"var,attr"`
|
|
} `xml:"feature"`
|
|
X []struct {
|
|
Text string `xml:",chardata"`
|
|
Type string `xml:"type,attr"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Field []struct {
|
|
Text string `xml:",chardata"`
|
|
Type string `xml:"type,attr"`
|
|
Var string `xml:"var,attr"`
|
|
Value string `xml:"value"`
|
|
} `xml:"field"`
|
|
} `xml:"x"`
|
|
}
|
|
|
|
type IQHttpUploadSlotRequest struct {
|
|
XMLName xml.Name `xml:"request"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
FileName string `xml:"filename,attr"`
|
|
FileType string `xml:"mime-type,attr"`
|
|
FileSize int64 `xml:"size,attr"`
|
|
}
|
|
|
|
// Created with https://github.com/miku/zek
|
|
type IQHttpUploadSlot struct {
|
|
XMLName xml.Name `xml:"slot"`
|
|
Text string `xml:",chardata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
Get struct {
|
|
Text string `xml:",chardata"`
|
|
URL string `xml:"url,attr"`
|
|
} `xml:"get"`
|
|
Put struct {
|
|
Text string `xml:",chardata"`
|
|
URL string `xml:"url,attr"`
|
|
Headers []struct {
|
|
Name string `xml:"name,attr"`
|
|
Value string `xml:",chardata"`
|
|
} `xml:"header"`
|
|
} `xml:"put"`
|
|
}
|