remoteimage

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package remoteimage fetches previews from user-approved HTTPS hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateHosts

func ValidateHosts(hosts []string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(hosts []string) *Client

New creates a fetcher for validated hosts. A nil client denies every URL.

func (*Client) Allows

func (c *Client) Allows(rawURL string) bool

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, rawURL string) ([]byte, bool, error)

Fetch returns the response body and whether it should be decoded as SVG.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL