API 레퍼런스는 소스 코드의 Go 문서 주석에서 추출되며 영어로 작성되어 있습니다.
package assets
import "github.com/nsgo-dev/game/pkg/tooling/assets"개요
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.
색인
타입
type CapExceededError struct{ Report Report }CapExceededError reports package limits with a deterministic report attached.
func (e *CapExceededError) Error() stringError 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.