project

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanRoute

func CleanRoute(path string) string

Types

type ChannelEntry

type ChannelEntry struct {
	Name     string
	File     string
	Function string
}

ChannelEntry is one loadable channel definition. Name identifies the reusable definition; dynamic instance keys are supplied at runtime.

type Project

type Project struct {
	RootDir string
}

func Detect

func Detect(cwd string) (*Project, error)

func (*Project) Channels

func (p *Project) Channels() ([]ChannelEntry, error)

Channels builds the lightweight startup index for websocket channel definitions. It reads paths only; source modules are compiled on demand.

func (*Project) Rel

func (p *Project) Rel(path string) string

func (*Project) ResolvePageRoute

func (p *Project) ResolvePageRoute(route string) (RouteEntry, bool, error)

ResolvePageRoute returns the public page selected for an HTTP route. The runtime represents the root page internally as /index, while the canonical project route is /. Both forms resolve to pages/index.gox.

func (*Project) Routes

func (p *Project) Routes() ([]RouteEntry, error)

func (*Project) UseAsWorkingDir

func (p *Project) UseAsWorkingDir() error

UseAsWorkingDir makes the project root the process working directory. User code compiled by Gox runs in-process, so relative paths used with standard Go APIs such as os.Open resolve from the project root.

func (*Project) Validate

func (p *Project) Validate() error

type RouteEntry

type RouteEntry struct {
	Route string
	File  string
}

Jump to

Keyboard shortcuts

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