GitHubLoslegen

Die API-Referenz stammt aus den Go-Doc-Kommentaren im Quellcode und ist auf Englisch verfasst.

package assets

import "github.com/nsgo-dev/game/pkg/tooling/assets"

Übersicht

Package assets is experimental: its API and documented formats may change in a minor release. See the API stability policy. lays out a game's measured asset groups into the main package, named subpackages and remote files as a project's asset delivery settings place them, and checks the result against the delivery's byte caps, for deterministic export-time package reports.

Index

Typen

type CapExceededError struct{ Report Report }

CapExceededError reports package limits with a deterministic report attached.

func (e *CapExceededError) Error() string

Error lists the report's violations.

type File struct {
	Path  string
	Bytes int64
}

File is one shipped asset with its byte size.

type Group struct {
	Name  string
	Files []File
}

Group is the measured output of one named asset group.

type Package struct {
	Name  string
	Files []File
	Bytes int64
}

Package is one package in a deterministic delivery report.

type Report struct {
	Main        Package
	Subpackages []Package
	Remote      []File
	TotalBytes  int64
	Violations  []string
}

Report is the package layout and cap evaluation for one export preset.

func Layout(delivery *project.AssetDelivery, groups []Group) (Report, error)

Layout places each measured group according to delivery. Unmentioned groups stay in main. The files of each package and the remote files are sorted by path, and subpackages by name, so reports are stable across filesystem traversal order; the groups passed in are not modified. A subpackage may not be named main.