buildpaths

package
v0.1.0-alpha.58 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package buildpaths centralizes the gobeyond.builds/v1 asset layout: the on-disk locations gobeyond build writes and the public URLs the runtime and CDN serve them from. Every producer and consumer of a build artifact must go through this package so the disk layout and the URL space never drift apart.

Disk:

dist/static/_gobeyond/builds/<build-id>/assets/...
dist/static/_gobeyond/builds/<build-id>/manifest.json
dist/static/_gobeyond/builds/<build-id>/static/<route-id>

URLs:

/_gobeyond/builds/<id>/assets/...
/_gobeyond/builds/<id>/manifest.json
/_gobeyond/builds/<id>/static/<route-id>
/_gobeyond/builds/<id>/runtime/...
/_gobeyond/builds/<id>/actions/...

Index

Constants

View Source
const (
	WorkersDir      = "workers"
	WorkerEntryName = "gobeyond-worker"
	WorkersManifest = "workers.json"
	AgentsManifest  = "agents.json"
	WakeManifest    = "wake.json"
	// DurablesAdapterTemporal is the v1 runtime adapter stamped into
	// dist/deploy/workers.json. Platform ensure/provisioning keys off this id.
	DurablesAdapterTemporal = "temporal"
)

Worker artifact locations inside dist/ under AssetLayoutV3.

View Source
const (
	KindAssets   = "assets"
	KindManifest = "manifest.json"
	KindStatic   = "static"
	KindRuntime  = "runtime"
	KindActions  = "actions"
)

Well-known path segments immediately following a build ID.

View Source
const AssetLayout = AssetLayoutV5

AssetLayout identifies the current on-disk/URL layout implemented by this package. It is published in build metadata so tooling and deployment references can detect the layout a build was produced with.

View Source
const AssetLayoutV5 = "gobeyond.builds/v5"

AssetLayoutV5 runs authored Go middleware inside the application process and emits the immutable proxy policy artifact.

View Source
const BuildsPrefix = "/_gobeyond/builds/"

BuildsPrefix is the reserved public URL prefix every build-scoped path falls under.

Variables

This section is empty.

Functions

func ActionURL

func ActionURL(buildID, actionID string) string

ActionURL is the public URL an action is submitted to.

func AssetBaseURL

func AssetBaseURL(buildID string) string

AssetBaseURL is the public URL root for one build's browser assets.

func AssetURL

func AssetURL(buildID, file string) string

AssetURL is the public URL for one emitted browser asset file. file may be slash-separated and is normalized to forward slashes.

func AssetsDir

func AssetsDir(staticDir, buildID string) string

AssetsDir is the on-disk directory browser assets are emitted into.

func BuildPathKind

func BuildPathKind(path string) (kind string, ok bool)

BuildPathKind returns the path segment immediately following the build ID in a "/_gobeyond/builds/<id>/<kind>/..." request, e.g. "runtime", "actions", "assets", "static", or "manifest.json". It reports ok=false when path is not under the builds namespace or is missing that segment.

func BuildRootURL

func BuildRootURL(buildID string) string

BuildRootURL is the public URL root for one build's artifacts.

func IsStaticArtifact

func IsStaticArtifact(path string) bool

IsStaticArtifact reports whether path addresses a build's static-served artifact (browser assets, the manifest, or packaged static route data) rather than a dynamic runtime/action request that must reach the Go handler.

func ManifestPath

func ManifestPath(staticDir, buildID string) string

ManifestPath is the on-disk location of a build's browser asset manifest.

func ManifestURL

func ManifestURL(buildID string) string

ManifestURL is the public URL for a build's browser asset manifest.

func ParseActionPath

func ParseActionPath(path string) (buildID, actionID string, ok bool)

ParseActionPath parses a "/_gobeyond/builds/<id>/actions/<actionId>" request path.

func ParseRuntimePath

func ParseRuntimePath(path string) (buildID, routeID string, ok bool)

ParseRuntimePath parses a "/_gobeyond/builds/<id>/runtime/<routeId>" request path.

func RuntimeURL

func RuntimeURL(buildID, routeID string) string

RuntimeURL is the public URL soft navigation fetches for one page route.

func StaticBuildRoot

func StaticBuildRoot(staticDir, buildID string) string

StaticBuildRoot is the on-disk root for one build's static artifacts.

func StaticRoutePath

func StaticRoutePath(staticDir, buildID, routeID string) string

StaticRoutePath is the on-disk location of one route's packaged static data.

func StaticRouteURL

func StaticRouteURL(buildID, routeID string) string

StaticRouteURL is the public URL for one build's packaged static route data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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