Documentation
¶
Index ¶
- Constants
- func EnsureGitIgnore(cwd string) error
- func FindRepoRoot(startDir string) (string, bool)
- func GetConfigHash(cwd string) (string, error)
- func GetJITBinaryPath(cwd string) (string, bool)
- func IsHandoffRequired(cwd string) bool
- func VerifyChecksum(cwd string) bool
- func WriteChecksum(cwd string, hash string) error
- type CompilerConfig
- type Lockfile
- type ModuleConfig
- type ResolvedPackage
Constants ¶
const ( HiddenDirName = ".typego" BinaryName = "typego-app.exe" HandoffEnvVar = "TYPEGO_HANDOFF" )
const ConfigFileName = "typego.modules.json"
const LockFileName = "typego.lock"
Variables ¶
This section is empty.
Functions ¶
func EnsureGitIgnore ¶
EnsureGitIgnore adds HiddenDirName to .gitignore if it exists and doesn't already contain it
func FindRepoRoot ¶
FindRepoRoot attempts to find the root of the typego repository by walking up from startDir
func GetConfigHash ¶
GetConfigHash returns the SHA256 hash of the typego.modules.json file
func GetJITBinaryPath ¶
GetJITBinaryPath returns the path to the JIT binary if it exists
func IsHandoffRequired ¶
IsHandoffRequired returns true if we should delegate to the JIT binary
func VerifyChecksum ¶
VerifyChecksum returns true if the current config hash matches the saved checksum
func WriteChecksum ¶
WriteChecksum saves the hash to .typego/checksum
Types ¶
type CompilerConfig ¶
type CompilerConfig struct {
GoVersion string `json:"goVersion,omitempty"`
Tags []string `json:"tags,omitempty"`
}
CompilerConfig holds settings for the Go toolchain
type Lockfile ¶
type Lockfile struct {
LockfileVersion int `json:"lockfileVersion"`
Resolved map[string]ResolvedPackage `json:"resolved"`
}
Lockfile captures resolved versions for reproducible builds
type ModuleConfig ¶
type ModuleConfig struct {
Schema string `json:"$schema,omitempty"`
Dependencies map[string]string `json:"dependencies"`
Replace map[string]string `json:"replace,omitempty"`
Compiler CompilerConfig `json:"compiler,omitempty"`
}
ModuleConfig represents the schema for typego.modules.json
func DefaultConfig ¶
func DefaultConfig() ModuleConfig
DefaultConfig returns a standard configuration template
func (*ModuleConfig) Validate ¶
func (c *ModuleConfig) Validate() error
Validate checks the configuration for common errors
type ResolvedPackage ¶
type ResolvedPackage struct {
Version string `json:"version"`
}
ResolvedPackage contains the exact version resolved by go get