Documentation
¶
Index ¶
- func AddGoOption(f *ast.File, mapValue *orderedmap.OrderedMap) error
- func Go(dir string, args ...string) error
- func GoFmt(dir string, args ...string) error
- func GoFumpt(dir string, args ...string) error
- func MergeNode(f *ast.File, path string, value ast.Node) error
- func Node(f *ast.File, path string) (ast.Node, error)
- func SearchTSP(dir string) ([]string, error)
- func TSP(dir string, args ...string) (string, error)
- type EmitOption
- type GoEmitterOptions
- type GoOption
- type LinterConfig
- type NodeX
- type RuleRef
- type TSPConfig
- func (tc *TSPConfig) EditEmit(emits []string)
- func (tc *TSPConfig) EditOptions(emit string, option any, append bool)
- func (tc *TSPConfig) EmitOption(emit string) (any, error)
- func (tc TSPConfig) ExistEmitOption(emit string) bool
- func (tc *TSPConfig) OnlyEmit(emit string)
- func (tc *TSPConfig) Write() error
- type TSPConfigX
- type TypeSpecAzureTools
- type TypeSpecProjectSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGoOption ¶
func AddGoOption(f *ast.File, mapValue *orderedmap.OrderedMap) error
将 @azure-tool/typespec-go 的配置添加到 ast.File 中
Types ¶
type EmitOption ¶
type GoEmitterOptions ¶
type GoEmitterOptions struct { AzcoreVersion string `yaml:"azcore-version"` DisallowUnknownFields bool `yaml:"disallow-unknown-fields"` FilePrefix string `yaml:"file-prefix"` GenerateFake bool `yaml:"generate-fakes"` InjectSpanc bool `yaml:"inject-spans"` Module string `yaml:"module"` ModuleVersion string `yaml:"module-version"` RawJsonAsBytes bool `yaml:"rawjson-as-bytes"` SliceElementsByVal bool `yaml:"slice-elements-byval"` SingleClient bool `yaml:"single-client"` Stutter string `yaml:"stutter"` FixConstStuttering bool `yaml:"fix-const-stuttering"` RemoveUnreferencedTypes bool `yaml:"remove-unreferenced-types"` }
https://github.com/Azure/autorest.go/blob/main/packages/typespec-go/src/lib.ts#GoEmitterOptions
@azure-tools/typespec-go option
type GoOption ¶
type GoOption struct { EmitOption GoEmitterOptions }
type LinterConfig ¶
type LinterConfig struct { Extends []RuleRef `yaml:"extends,omitempty"` Enable map[RuleRef]bool `yaml:"enable,omitempty"` Disable map[RuleRef]string `yaml:"disable,omitempty"` }
<library name>:<rule/ruleset name>
type TSPConfig ¶
type TSPConfig struct { Path string TypeSpecProjectSchema }
func NewTSPConfig ¶
func (*TSPConfig) EditOptions ¶
func (TSPConfig) ExistEmitOption ¶
type TSPConfigX ¶
type TSPConfigX struct { TSPConfig // contains filtered or unexported fields }
func (*TSPConfigX) Marshal ¶
func (t *TSPConfigX) Marshal() ([]byte, error)
func (*TSPConfigX) Unmarshal ¶
func (t *TSPConfigX) Unmarshal(data []byte) error
type TypeSpecAzureTools ¶
type TypeSpecAzureTools string
const ( TypeSpec_GO TypeSpecAzureTools = "@azure-tools/typespec-go" TypeSpec_AUTOREST TypeSpecAzureTools = "@azure-tools/typespec-autorest" TypeSpec_CSHARP TypeSpecAzureTools = "@azure-tools/typespec-csharp" TypeSpec_PYTHON TypeSpecAzureTools = "@azure-tools/typespec-python" TypeSpec_TS TypeSpecAzureTools = "@azure-tools/typespec-ts" )
type TypeSpecProjectSchema ¶
type TypeSpecProjectSchema struct { Extends string `yaml:"extends,omitempty"` Parameters map[string]any `yaml:"parameters,omitempty"` EnvironmentVariables map[string]any `yaml:"environment-variables,omitempty"` WarnAsError bool `yaml:"warn-as-error,omitempty"` OutPutDir string `yaml:"output-dir,omitempty"` // 不应该是bool Trace []string `yaml:"trace,omitempty"` Imports string `yaml:"imports,omitempty"` Emit []string `yaml:"emit,omitempty"` Options map[string]any `yaml:"options,omitempty"` Linter LinterConfig `yaml:"linter,omitempty"` }
Click to show internal directories.
Click to hide internal directories.