Documentation ¶
Index ¶
- type Echo
- func (e *Echo) DefaultOptions() interface{}
- func (e *Echo) Description() string
- func (e *Echo) DescriptionMarkdown() string
- func (e *Echo) Generate(ctx context.Context, options interface{}, sp *spec.Spec, target string) (interface{}, error)
- func (e *Echo) GenerateScaffold(ctx context.Context, sp *spec.Spec, opts *EchoOptions) (jen.Code, error)
- func (e *Echo) GenerateServer(ctx context.Context, sp *spec.Spec, opts *EchoOptions) (jen.Code, error)
- func (e *Echo) GenerateWrapper(ctx context.Context, sp *spec.Spec, opts *EchoOptions) (jen.Code, error)
- func (e *Echo) Name() string
- func (e *Echo) Targets() map[string]string
- type EchoOptions
- type General
- func (g *General) DefaultOptions() interface{}
- func (g *General) Description() string
- func (g *General) DescriptionMarkdown() string
- func (g *General) Generate(ctx context.Context, options interface{}, specification *spec.Spec, ...) (interface{}, error)
- func (g *General) GenerateHelpers(ctx context.Context, schema *spec.Schema, opts *GeneralOptions) (jen.Code, error)
- func (g *General) GenerateSpec(ctx context.Context, spBytes []byte, funcName string) (jen.Code, error)
- func (g *General) GenerateType(ctx context.Context, schema *spec.Schema, opts *GeneralOptions) (jen.Code, error)
- func (g *General) GenerateTypes(ctx context.Context, specification *spec.Spec, opts *GeneralOptions) (jen.Code, error)
- func (g *General) GetOpts(ctx context.Context) (*GeneralOptions, error)
- func (g *General) Name() string
- func (g *General) Targets() map[string]string
- type GeneralOptions
- type StdLib
- func (s *StdLib) DefaultOptions() interface{}
- func (s *StdLib) Description() string
- func (s *StdLib) DescriptionMarkdown() string
- func (s *StdLib) Generate(ctx context.Context, options interface{}, specification *spec.Spec, ...) (interface{}, error)
- func (s *StdLib) GenerateCallbacks(ctx context.Context, specification *spec.Spec, opts *StdLibOptions) (jen.Code, error)
- func (s *StdLib) GenerateClient(ctx context.Context, specification *spec.Spec, opts *StdLibOptions) (jen.Code, error)
- func (s *StdLib) GenerateRequest(ctx context.Context, funcName jen.Code, url jen.Code, path string, ...) (jen.Code, error)
- func (s *StdLib) Name() string
- func (s *StdLib) Targets() map[string]string
- type StdLibOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Echo ¶
type Echo struct{}
Echo provides code generation for the Echo framework
func (*Echo) DefaultOptions ¶
func (e *Echo) DefaultOptions() interface{}
DefaultOptions implements Generator
func (*Echo) DescriptionMarkdown ¶
DescriptionMarkdown implements DescriptionMarkdown
func (*Echo) Generate ¶
func (e *Echo) Generate(ctx context.Context, options interface{}, sp *spec.Spec, target string) (interface{}, error)
Generate implements Generator
func (*Echo) GenerateScaffold ¶
func (*Echo) GenerateServer ¶
func (e *Echo) GenerateServer(ctx context.Context, sp *spec.Spec, opts *EchoOptions) (jen.Code, error)
GenerateServer generates the server interface, And the register function.
type EchoOptions ¶
type EchoOptions struct { ServerName string `yaml:"serverName,omitempty" description:"Name of the server interface"` ServerImplName string `yaml:"serverImplName,omitempty" description:"Name of the server interface implementation"` AllowNoResponse bool `` /* 154-byte string literal not displayed */ ServerPackagePath string `` /* 169-byte string literal not displayed */ TypesPackagePath string `` /* 175-byte string literal not displayed */ ResponsePostfix string `yaml:"responsePostfix" description:"Postfix to add for response types, configure it to avoid collisions with actual types"` ShortScaffoldComments bool `yaml:"shortScaffoldComments" description:"Shorter scaffold comments for each method implementation"` ServerMiddleware bool `` /* 141-byte string literal not displayed */ }
EchoOptions is the options for the Echo target.
func (*EchoOptions) MarshalYAML ¶
func (e *EchoOptions) MarshalYAML() (interface{}, error)
MarshalYAML implements YAML Marshaler
type General ¶
type General struct{}
General generates framework-independent code.
func (*General) DefaultOptions ¶
func (g *General) DefaultOptions() interface{}
DefaultOptions implements Generator
func (*General) Description ¶
Description implements Generator
func (*General) DescriptionMarkdown ¶
DescriptionMarkdown implements DescriptionMarkdown
func (*General) Generate ¶
func (g *General) Generate(ctx context.Context, options interface{}, specification *spec.Spec, target string) (interface{}, error)
Generate implements Generator
func (*General) GenerateHelpers ¶
func (g *General) GenerateHelpers(ctx context.Context, schema *spec.Schema, opts *GeneralOptions) (jen.Code, error)
GenerateHelpers generates various helper functions for a type.
func (*General) GenerateSpec ¶
func (g *General) GenerateSpec(ctx context.Context, spBytes []byte, funcName string) (jen.Code, error)
GenerateSpec generates code that stores the specifications in base64, and a function to decode them to a map of bytes.
func (*General) GenerateType ¶
func (g *General) GenerateType(ctx context.Context, schema *spec.Schema, opts *GeneralOptions) (jen.Code, error)
GenerateType generates a single type from a schema
type GeneralOptions ¶
type GeneralOptions struct { GenerateTypeHelpers bool `yaml:"generateTypeHelpers" description:"Generate helper functions and methods for types"` GenerateGettersAndSetters bool `` /* 173-byte string literal not displayed */ GenerateMarshalMethods bool `yaml:"generateMarshalMethods" description:"Generate marshal/unmarshal methods for types that need them"` TypesPackagePath string `yaml:"typesPackagePath,omitempty" description:"Package path to already generated types (used internally)"` ExpandEnums bool `yaml:"expandEnums" description:"Expand enums into const (...) blocks if possible"` }
GeneralOptions are options the General target.
func (*GeneralOptions) MarshalYAML ¶
func (g *GeneralOptions) MarshalYAML() (interface{}, error)
MarshalYAML implements YAML Marshaler
type StdLib ¶
type StdLib struct{}
StdLib generates code for the standard library.
func (*StdLib) DefaultOptions ¶
func (s *StdLib) DefaultOptions() interface{}
DefaultOptions implements Target
func (*StdLib) DescriptionMarkdown ¶
DescriptionMarkdown implements DescriptionMarkdown
func (*StdLib) Generate ¶
func (s *StdLib) Generate(ctx context.Context, options interface{}, specification *spec.Spec, target string) (interface{}, error)
Generate implements Target
func (*StdLib) GenerateCallbacks ¶
func (s *StdLib) GenerateCallbacks(ctx context.Context, specification *spec.Spec, opts *StdLibOptions) (jen.Code, error)
GenerateClient generates Go HTTP requests.
func (*StdLib) GenerateClient ¶
func (s *StdLib) GenerateClient(ctx context.Context, specification *spec.Spec, opts *StdLibOptions) (jen.Code, error)
GenerateClient generates Go HTTP requests.
func (*StdLib) GenerateRequest ¶
type StdLibOptions ¶
type StdLibOptions struct {
TypesPackagePath string `` /* 133-byte string literal not displayed */
}