Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLIShorthands ¶ added in v2.961.0
type CLIShorthands struct {
// contains filtered or unexported fields
}
CLIShorthands collects the auto-assigned CLI flag shorthands that templates resolve for each operation, for persistence in the gen.lock cliShorthands section. Recording is ignored until Start, so template runs that must not replace the lock section (snippet-only generation) leave it untouched.
func (*CLIShorthands) Record ¶ added in v2.961.0
func (c *CLIShorthands) Record(operationID, serializationMethod string, resolution map[string]any, split bool)
Record stores the resolution of one operation's request serialization method, omitting empty flags and retired maps so operations without shorthands do not add lock entries. A split operation keeps an empty method entry, which stops a later single command from inheriting a sibling's entry.
func (*CLIShorthands) Result ¶ added in v2.961.0
func (c *CLIShorthands) Result() (map[string]any, bool)
Result returns the recorded section and whether recording was started.
func (*CLIShorthands) Start ¶ added in v2.961.0
func (c *CLIShorthands) Start()
type Features ¶
type Features interface {
Target() types.Target
GetImplementedFeaturesList(ctx context.Context) []features.Feature
IsFeatureSupported(ctx context.Context, feature features.Feature) bool
IsFeatureEnabled(ctx context.Context, feature features.Feature) bool
IsFeatureIgnored(ctx context.Context, feature features.Feature) bool
IsUnionWrapper(ctx context.Context) bool
GetFeatureVersion(ctx context.Context, feature features.Feature) string
IsReadmeSectionImplemented(ctx context.Context, readmeSectionID string) bool
IsReadmeSectionIgnored(ctx context.Context, readmeSectionID string) bool
RecordFeatureUsage(ctx context.Context, feature features.Feature)
RegisterReadmeSectionTemplated(readmeSectionID string, feature features.Feature)
ReinstateFeatureUsage(ctx context.Context, featureUsage map[string]bool)
GetFeatureUsage(ctx context.Context) map[string]bool
GetUsedFeatures(ctx context.Context) map[string]string
GetAvailableFeatures(ctx context.Context) map[string]bool
IsFeatureUsed(feature features.Feature) bool
GetAutoGeneratedHeader(ctx context.Context, generatedID string) string
CollectGlobalsAndServersModels(ctx context.Context) bool
}
type InitOptions ¶
type InitOptions struct {
Target types.Target
Config *configuration.Config
BaseTemplateConfigs map[string]any
OutDir string
GenLockId string
FS filesystem.FileSystem
Git merge.Git
LockFile *config.LockFile
}
type Subsystem ¶
type Subsystem struct {
Config *configuration.Config // the parsed configuration (usually from gen.yaml)
Features Features // system for managing feature enablement and recording of used features
Extensions *extensions.Extensions // system for parsing extensions and handling extension rewrites
Register *register.Register // type system register
Target types.Target
Cycles *cycles.CycleDetector
Sanitizer Sanitizer
FileTracker *filetracking.Tracker
Patches *patches.Subsystem // system for 3-way merge with persistent edits
// CLIShorthands collects CLI flag shorthands for the gen.lock cliShorthands section
CLIShorthands *CLIShorthands
}
Subsystem represents the subsystems of the generator that are normally used by multiple other packages in addition to the generator itself This container class was create to make it simpler to pass around and standardize access to avoid large param lists or options objects
func New ¶
func New(fileTracker *filetracking.Tracker) *Subsystem