Documentation
¶
Overview ¶
ABOUTME: Configuration file loader for .bingo.yaml metadata ABOUTME: Reads service mappings from bingo project template
ABOUTME: Template fetcher for downloading and caching bingo project from GitHub ABOUTME: Handles tarball download, extraction, and local caching with file locking
ABOUTME: Package name and directory name replacer for template processing ABOUTME: Handles module name substitution and directory renaming
ABOUTME: Template version management for GitHub-based template fetching ABOUTME: Defines default version and ref validation logic
Index ¶
Constants ¶
const BingoAppName = "bingo"
BingoAppName is the default app name used in bingo template
const BingoRootPackage = "github.com/bingo-project/bingo"
BingoRootPackage is the root package of the bingo template This should match the module name in bingo's go.mod
const DefaultTemplateVersion = "main"
DefaultTemplateVersion is the recommended template version
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BingoConfig ¶ added in v1.5.6
type BingoConfig struct {
Version int `yaml:"version"`
Services map[string]ServiceInfo `yaml:"services"`
}
BingoConfig represents .bingo.yaml configuration file structure
func LoadBingoConfig ¶ added in v1.5.6
func LoadBingoConfig(path string) (*BingoConfig, error)
LoadBingoConfig loads and parses .bingo.yaml
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher handles template downloading and caching
func (*Fetcher) FetchTemplate ¶
FetchTemplate downloads template to cache (if not exists), returns cache path Execution steps: 1. Check cache directory exists, create if not (permission 0755) 2. Check cache directory is writable, return friendly error if not 3. Check cache hit (unless noCache=true) 4. If need to download, acquire file lock, download and extract to cache 5. Return cache path
type Replacer ¶
type Replacer struct {
// contains filtered or unexported fields
}
Replacer handles module name and directory name replacement
func NewReplacer ¶
NewReplacer creates a new Replacer instance
func (*Replacer) RenameConfigFiles ¶ added in v1.6.1
RenameConfigFiles renames config files according to explicit rules Only renames files that exist (some may be filtered out with services)
func (*Replacer) RenameDirs ¶
RenameDirs renames directories according to explicit rules Only renames directories that still exist (after service filtering)
func (*Replacer) ReplaceAppName ¶ added in v1.6.1
ReplaceAppName replaces app name references in files Should be called after ReplaceModuleName to avoid conflicts with module paths
func (*Replacer) ReplaceBingoConfig ¶ added in v1.6.2
ReplaceBingoConfig replaces values in .bingo.example.yaml Replaces rootPackage and database fields with the new module/app name
func (*Replacer) ReplaceModuleName ¶
ReplaceModuleName replaces all files with module name Traverses target directory, replaces based on file extension
type ServiceInfo ¶
type ServiceInfo struct {
Cmd string `yaml:"cmd"`
Internal string `yaml:"internal"`
Description string `yaml:"description"`
}
ServiceInfo describes a service's directory structure