Documentation ¶
Overview ¶
Package upload implements sending files by uploading them to an HTTP server.
Index ¶
- Constants
- Variables
- type File
- type Slot
- func (s Slot) MarshalXML(e *xml.Encoder, _ xml.StartElement) error
- func (s Slot) Put(ctx context.Context, body io.Reader) (*http.Request, error)
- func (s Slot) TokenReader() xml.TokenReader
- func (s *Slot) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (s Slot) WriteXML(w xmlstream.TokenWriter) (n int, err error)
Constants ¶
const NS = "urn:xmpp:http:upload:0"
NS is the namespace used by this package.
Variables ¶
var (
Feature = info.Feature{Var: NS}
)
A list of service discovery features that are supported by this package.
Functions ¶
This section is empty.
Types ¶
type File ¶
File describes a file to be uploaded.
func (File) MarshalXML ¶
MarshalXML implements xml.Marshaler.
func (File) TokenReader ¶
func (f File) TokenReader() xml.TokenReader
TokenReader satisfies the xmlstream.Marshaler interface.
func (*File) UnmarshalXML ¶
UnmarshalXML implements xml.Unmarshaler.
type Slot ¶
type Slot struct { PutURL *url.URL GetURL *url.URL // Header is the headers that will be set on put requests from the slot. // The only valid headers are "Authorization", "Cookie", and "Expires". // All other headers will be ignored. Header http.Header }
Slot is a place where a file can be uploaded and later retrieved.
func GetSlotIQ ¶
GetSlotIQ is like GetSlot except that it lets you customize the IQ. Changing the type of the IQ has no effect.
func (Slot) MarshalXML ¶
MarshalXML implements xml.Marshaler.
func (Slot) Put ¶
Put returns a put request with the appropriate headers that can be used to upload a file to the slot.
func (Slot) TokenReader ¶
func (s Slot) TokenReader() xml.TokenReader
TokenReader satisfies the xmlstream.Marshaler interface.
func (*Slot) UnmarshalXML ¶
UnmarshalXML implements xml.Unmarshaler.