Documentation
¶
Index ¶
- Constants
- type CSharpLanguageOptions
- type Configuration
- type GeneratorArgs
- type GeneratorConf
- type GeneratorConfig
- type GeneratorType
- type GoLanguageOptions
- type JavaLanguageOptions
- type KotlinLanguageOptions
- type KrakenDOptions
- type LLMsOptions
- type Link
- type MaintainerConf
- type OpenApiGeneratorOptions
- type PresetConf
- type PrimeCodeGenOptions
- type PrintingPressOptions
- type ProviderConf
- type PythonLanguageOptions
- type RepositoryConf
- type ScaffoldingOptions
- type Spec
- type SpecSource
- type Trademark
- type TypescriptLanguageOptions
Constants ¶
View Source
const ConfigFileName = "primelib.yaml"
ConfigFileName is the default name of the configuration file
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSharpLanguageOptions ¶
type Configuration ¶
type Configuration struct {
Output string `yaml:"output,omitempty" jsonschema_description:"output directory for the generated code"`
OutputSubDir bool `yaml:"outputSubDir,omitempty" jsonschema_description:"create a subdirectory for each generator in the output directory"`
Repository RepositoryConf `yaml:"repository"`
Maintainers []MaintainerConf `yaml:"maintainers"`
Provider ProviderConf `yaml:"provider"`
Generators []GeneratorConf `yaml:"generators"` // Generators can be used to fully customize the generation process
Presets PresetConf `yaml:"presets"` // Presets are pre-configured generators for specific languages
Spec Spec `yaml:"spec"`
}
func LoadConfig ¶
func LoadConfig(content string) (Configuration, error)
func (Configuration) HasGenerator ¶
func (c Configuration) HasGenerator() bool
func (Configuration) MultiLanguage ¶
func (c Configuration) MultiLanguage() bool
type GeneratorArgs ¶
type GeneratorArgs struct {
// UserArgs are the arguments that are passed to the generator
OpenAPIGeneratorArgs []string `yaml:"openapi_generator"`
}
type GeneratorConf ¶
type GeneratorConf struct {
Enabled bool `yaml:"enabled"` // Enable the generator
Name string `yaml:"name"` // Name of the generator
Type GeneratorType `yaml:"type"` // Type of the generator
Arguments []string `yaml:"arguments"` // Arguments that are passed to the generator command
Config map[string]interface{} `yaml:"config"` // Config that is passed to the generator
}
type GeneratorConfig ¶
type GeneratorConfig struct {
GeneratorName string `json:"generatorName" yaml:"generatorName"`
InvokerPackage string `json:"invokerPackage" yaml:"invokerPackage"`
ApiPackage string `json:"apiPackage" yaml:"apiPackage"`
ModelPackage string `json:"modelPackage" yaml:"modelPackage"`
EnablePostProcessFile bool `json:"enablePostProcessFile" yaml:"enablePostProcessFile"`
GlobalProperty map[string]interface{} `json:"globalProperty" yaml:"globalProperty"`
AdditionalProperties map[string]interface{} `json:"additionalProperties" yaml:"additionalProperties"`
}
type GeneratorType ¶
type GeneratorType string
const ( GeneratorTypeOpenApiGenerator GeneratorType = "openapi-generator" GeneratorTypePrimeCodeGen GeneratorType = "primecodegen" GeneratorTypeSpeakEasy GeneratorType = "speakeasy" GeneratorTypePrintingPress GeneratorType = "printing-press" )
type GoLanguageOptions ¶
type JavaLanguageOptions ¶
type KotlinLanguageOptions ¶
type KrakenDOptions ¶
type LLMsOptions ¶
type MaintainerConf ¶
type OpenApiGeneratorOptions ¶
type PresetConf ¶
type PresetConf struct {
Scaffolding ScaffoldingOptions `yaml:"scaffolding"`
Go GoLanguageOptions `yaml:"go"`
Java JavaLanguageOptions `yaml:"java"`
Kotlin KotlinLanguageOptions `yaml:"kotlin"`
Python PythonLanguageOptions `yaml:"python"`
CSharp CSharpLanguageOptions `yaml:"csharp"`
Typescript TypescriptLanguageOptions `yaml:"typescript"`
KrakenD KrakenDOptions `yaml:"krakend"`
PrintingPress PrintingPressOptions `yaml:"printingpress"`
LLMs LLMsOptions `yaml:"llms"`
}
PresetConf are pre-configured generators for specific languages
func (PresetConf) EnabledCount ¶
func (c PresetConf) EnabledCount() int
type PrimeCodeGenOptions ¶
type PrintingPressOptions ¶
type ProviderConf ¶
type PythonLanguageOptions ¶
type RepositoryConf ¶
type ScaffoldingOptions ¶
type Spec ¶
type Spec struct {
// File is the path to the openapi specification file
File string `yaml:"file" default:"openapi.yaml" required:"true"`
// SourcesDir is the directory where specifications are stored
SourcesDir string `yaml:"sourcesDir"`
// Sources contains one or multiple sources to specifications
Sources []SpecSource `yaml:"sources" required:"true"`
// Type is the format of the api specification
Type openapidocument.SpecType `yaml:"type" required:"true"`
// InputPatches are applied to the source specifications before merging
InputPatches []sharedpatch.SpecPatch `yaml:"inputPatches"`
// PatchSets are the named patch sets that are applied to the specification
PatchSets []openapipatch.PatchSet `yaml:"patchSets"`
// Patches are the patches that are applied to the specification
Patches []sharedpatch.SpecPatch `yaml:"patches"`
}
func (Spec) GetSourcesDir ¶
type SpecSource ¶
type SpecSource struct {
File string `yaml:"file"` // File path to the openapi specification
URL string `yaml:"url"` // URL to the openapi specification
Format openapidocument.SourceType `yaml:"format" default:"spec"`
Type openapidocument.SpecType `yaml:"type"`
Patches []sharedpatch.SpecPatch `yaml:"patches"` // Patches are the patches that are applied to the specification
}
Click to show internal directories.
Click to hide internal directories.