generator

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientGenerator

type ClientGenerator struct {
	ServiceName string
	URL         *url.URL
	// contains filtered or unexported fields
}

func NewClientGenerator

func NewClientGenerator(serviceName string, u *url.URL) *ClientGenerator

func (*ClientGenerator) Load

func (g *ClientGenerator) Load()

func (*ClientGenerator) Output

func (g *ClientGenerator) Output(cwd string)

type OperationGenerator

type OperationGenerator struct {
	ServiceName string
	File        *codegen.File
}

func NewOperationGenerator

func NewOperationGenerator(serviceName string, file *codegen.File) *OperationGenerator

func (*OperationGenerator) ID

func (g *OperationGenerator) ID(id string) string

func (*OperationGenerator) ParamField

func (g *OperationGenerator) ParamField(parameter *oas.Parameter) *codegen.SnippetField

func (*OperationGenerator) RequestBodyField

func (g *OperationGenerator) RequestBodyField(requestBody *oas.RequestBody) *codegen.SnippetField

func (*OperationGenerator) ResponseType

func (g *OperationGenerator) ResponseType(responses *oas.Responses) (codegen.SnippetType, []string)

func (*OperationGenerator) Scan

func (g *OperationGenerator) Scan(openapi *oas.OpenAPI)

func (*OperationGenerator) WriteOperation

func (g *OperationGenerator) WriteOperation(method string, path string, operation *oas.Operation)

type ServiceClientGenerator added in v1.6.0

type ServiceClientGenerator struct {
	ServiceName string
	File        *codegen.File
}

func NewServiceClientGenerator added in v1.6.0

func NewServiceClientGenerator(serviceName string, file *codegen.File) *ServiceClientGenerator

func (*ServiceClientGenerator) ClientInstanceName added in v1.6.0

func (g *ServiceClientGenerator) ClientInstanceName() string

func (*ServiceClientGenerator) ClientInterfaceName added in v1.6.0

func (g *ServiceClientGenerator) ClientInterfaceName() string

func (*ServiceClientGenerator) OperationMethod added in v1.6.0

func (g *ServiceClientGenerator) OperationMethod(operation *oas.Operation, asInterface bool) codegen.Snippet

func (*ServiceClientGenerator) Scan added in v1.6.0

func (g *ServiceClientGenerator) Scan(openapi *oas.OpenAPI)

func (*ServiceClientGenerator) WriteClient added in v1.6.0

func (g *ServiceClientGenerator) WriteClient()

func (*ServiceClientGenerator) WriteClientInterface added in v1.6.0

func (g *ServiceClientGenerator) WriteClientInterface(openapi *oas.OpenAPI)

type TypeGenerator

type TypeGenerator struct {
	ServiceName string
	File        *codegen.File
	Enums       map[string][]enumeration.EnumOption
}

func NewTypeGenerator

func NewTypeGenerator(serviceName string, file *codegen.File) *TypeGenerator

func (*TypeGenerator) BasicType

func (g *TypeGenerator) BasicType(schemaType string, format string) codegen.SnippetType

func (*TypeGenerator) FieldOf

func (g *TypeGenerator) FieldOf(name string, propSchema *oas.Schema, requiredFields map[string]bool) *codegen.SnippetField

func (*TypeGenerator) FieldsFrom

func (g *TypeGenerator) FieldsFrom(schema *oas.Schema) (fields []*codegen.SnippetField)

func (*TypeGenerator) Scan

func (g *TypeGenerator) Scan(openapi *oas.OpenAPI)

func (*TypeGenerator) Type

func (g *TypeGenerator) Type(schema *oas.Schema) (codegen.SnippetType, bool)

func (*TypeGenerator) TypeIndirect

func (g *TypeGenerator) TypeIndirect(schema *oas.Schema) (codegen.SnippetType, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL