Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxRetriesReached = errors.New("reached the request retries limit") ErrFailedToParseRequestOptions = errors.New("there was an error while executing request options") ErrExecutingRequest = errors.New("something went wrong while executing this request") ErrFailedToParseResponseOptions = errors.New("there was an error while executing response options") ErrTooManyRequests = errors.New("your have sent too many request to this bucket, wait and try again") )
Functions ¶
func NewJSONRequest ¶
func NewJSONRequest[T any](c *Client, fn func(b RequestBuilder) error) (dst T, err error)
func NewRequest ¶
func NewRequest(c *Client, fn func(b RequestBuilder) error) error
func ResolvePath ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CustomGlobalLimiter ¶
type DiscordError ¶
type DiscordError struct {
Message string `json:"message"`
Errors json.RawMessage `json:"errors"`
Code int `json:"code"`
}
func (DiscordError) Error ¶
func (e DiscordError) Error() string
type RequestBuilder ¶
type RequestBuilder interface {
Method(m string) RequestBuilder
Header(name, value string) RequestBuilder
Body(v any) RequestBuilder
Reason(...string) RequestBuilder
Parse(v any) RequestBuilder
Retries(n uint) RequestBuilder
NoAuth() RequestBuilder
Debug() RequestBuilder
Multipart(fn func(writer *multipart.Writer) error) RequestBuilder
OnRequest(opts ...RequestOption) RequestBuilder
OnResponse(opts ...ResponseOption) RequestBuilder
Execute(segments ...string) error
}
type RequestOption ¶
type ResponseOption ¶
Click to show internal directories.
Click to hide internal directories.