assets

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMaxBytes int64 = 10 << 20

Variables

View Source
var (
	ErrUnsupportedAsset = errors.New("unsupported asset URL")
	ErrAssetTooLarge    = errors.New("asset exceeds configured limit")
)

Functions

This section is empty.

Types

type Resolver

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

Resolver confines local assets to workspace roots and fetches remote assets through an injected client.

func New

func New(workspaces *workspace.Roots, client *http.Client, maxBytes int64) (*Resolver, error)

func (*Resolver) DataURI

func (resolver *Resolver) DataURI(ctx context.Context, rootName, reference string) (string, error)

DataURI resolves one local or remote image into a bounded data URI.

func (*Resolver) EmbedSVGImages

func (resolver *Resolver) EmbedSVGImages(ctx context.Context, rootName string, source []byte) ([]byte, error)

EmbedSVGImages replaces generated SVG image references with bounded data URIs.

Jump to

Keyboard shortcuts

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