asset

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestVersion = 2

ManifestVersion is the current gowdk-assets.json schema version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Version    int               `json:"version"`
	Files      map[string]string `json:"files"`
	Hashes     map[string]string `json:"hashes,omitempty"`
	Cache      map[string]string `json:"cache,omitempty"`
	Sizes      map[string]int64  `json:"sizes,omitempty"`
	Obfuscated map[string]bool   `json:"obfuscated,omitempty"`
}

Manifest maps logical asset names to emitted paths.

func (Manifest) CachePolicy added in v0.1.5

func (manifest Manifest) CachePolicy(name string) string

CachePolicy returns the HTTP cache policy recorded for a logical asset name.

func (Manifest) Hash added in v0.1.5

func (manifest Manifest) Hash(name string) string

Hash returns the content hash recorded for a logical asset name.

func (Manifest) IsObfuscated added in v0.5.0

func (manifest Manifest) IsObfuscated(name string) bool

IsObfuscated reports whether a logical asset name was emitted through the production generated-asset obfuscation lane.

func (Manifest) Resolve

func (manifest Manifest) Resolve(name string) string

Resolve returns the emitted path for a logical asset name.

func (Manifest) SizeBytes added in v0.5.0

func (manifest Manifest) SizeBytes(name string) int64

SizeBytes returns the generated asset byte size recorded for a logical asset name, or zero when the manifest has no size metadata for that asset.

func (Manifest) URL

func (manifest Manifest) URL(name string) string

URL returns the browser-facing URL for a logical asset name.

Jump to

Keyboard shortcuts

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