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

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