Documentation ¶ Overview ¶ Package remote downloads media from HTTP(S) URLs for WeChat upload. Index ¶ func Download(ctx context.Context, rawURL string) (data []byte, fileName string, err error) func DownloadWithClient(ctx context.Context, client *http.Client, rawURL string) (data []byte, fileName string, err error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Download ¶ func Download(ctx context.Context, rawURL string) (data []byte, fileName string, err error) Download fetches a remote URL and returns the body bytes plus a suggested filename. The context controls the request timeout/cancellation. Downloads are capped at 100 MiB to avoid unbounded memory use. func DownloadWithClient ¶ added in v0.3.0 func DownloadWithClient(ctx context.Context, client *http.Client, rawURL string) (data []byte, fileName string, err error) DownloadWithClient fetches a remote URL using the supplied HTTP client. Types ¶ This section is empty. Source Files ¶ View all Source files download.go Click to show internal directories. Click to hide internal directories.