Documentation
¶
Overview ¶
Package http implements the host-only, single-attempt Discord HTTP boundary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidConfig = errors.New("DISCORD_HTTP_INVALID_CONFIG") ErrInvalidRequest = errors.New("DISCORD_HTTP_INVALID_REQUEST") ErrBodyTooLarge = errors.New("DISCORD_HTTP_BODY_TOO_LARGE") ErrHeadersTooLarge = errors.New("DISCORD_HTTP_HEADERS_TOO_LARGE") ErrResponseTooLarge = errors.New("DISCORD_HTTP_RESPONSE_TOO_LARGE") ErrCapacity = errors.New("DISCORD_HTTP_CAPACITY_EXHAUSTED") ErrClosed = errors.New("DISCORD_HTTP_CLOSED") ErrTransport = errors.New("DISCORD_HTTP_TRANSPORT_FAILURE") ErrFile = errors.New("DISCORD_HTTP_FILE_FAILURE") )
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Name string
Filename string
ContentType string
Size int64
Open func(context.Context) (io.ReadCloser, error)
}
Open must honor ctx; Close on its result must interrupt an ongoing Read. The caller retains its source lease until Do has returned.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func New ¶
New copies the trusted client; redirects and transparent replay are disabled. A standard Transport is cloned so its response-header and connection bounds do not mutate the caller's transport. A custom RoundTripper must itself honor request cancellation and enforce bounded header parsing before returning.
Click to show internal directories.
Click to hide internal directories.