compiler

package
v0.0.0-...-a037c27 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	// contains filtered or unexported fields
}

func (*Array) Elem

func (a *Array) Elem() string

func (*Array) Name

func (a *Array) Name() string

func (*Array) ResolveIncomplete

func (a *Array) ResolveIncomplete(ctx *compileCtx) (Type, error)

func (*Array) SetName

func (a *Array) SetName(s string)

type Builtin

type Builtin string

func (Builtin) Name

func (b Builtin) Name() string

func (Builtin) ResolveIncomplete

func (b Builtin) ResolveIncomplete(ctx *compileCtx) (Type, error)

func (Builtin) SetName

func (b Builtin) SetName(s string)

type Call

type Call struct {
	// contains filtered or unexported fields
}

func (*Call) AllFields

func (call *Call) AllFields() []*Field

func (*Call) Body

func (call *Call) Body() Type

func (*Call) Consumes

func (call *Call) Consumes() []string

func (*Call) DefaultConsumes

func (call *Call) DefaultConsumes() string

func (*Call) Header

func (call *Call) Header() Type

func (*Call) Method

func (call *Call) Method() string

func (*Call) Name

func (call *Call) Name() string

func (*Call) Optionals

func (call *Call) Optionals() []*Field

func (*Call) Path

func (call *Call) Path() Type

func (*Call) Query

func (call *Call) Query() Type

func (*Call) RequestPath

func (call *Call) RequestPath() string

func (*Call) Requireds

func (call *Call) Requireds() []*Field

func (*Call) Responses

func (call *Call) Responses() []*Response

func (*Call) SecuritySettings

func (call *Call) SecuritySettings() []*SecuritySettings

func (*Call) Verb

func (call *Call) Verb() string

type ClientDefinition

type ClientDefinition struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(spec openapi.OpenAPI, defaultServiceName string) (*ClientDefinition, error)

func (*ClientDefinition) Definitions

func (c *ClientDefinition) Definitions() map[string]TypeDefinition

func (*ClientDefinition) ServiceNames

func (c *ClientDefinition) ServiceNames() []string

func (*ClientDefinition) Services

func (c *ClientDefinition) Services() map[string]*Service

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (*Field) ContainerName

func (f *Field) ContainerName() string

func (*Field) Hints

func (f *Field) Hints() Hints

func (*Field) In

func (f *Field) In() openapi.Location

func (*Field) Name

func (f *Field) Name() string

func (*Field) Required

func (f *Field) Required() bool

func (*Field) Type

func (f *Field) Type() Type

type Hints

type Hints struct {
	GoName string // camelCase name
	GoTag  string
	JsName string
}

type Incomplete

type Incomplete string

func (Incomplete) Name

func (v Incomplete) Name() string

func (Incomplete) ResolveIncomplete

func (v Incomplete) ResolveIncomplete(ctx *compileCtx) (Type, error)

func (Incomplete) SetName

func (v Incomplete) SetName(s string)

type Response

type Response struct {
	// contains filtered or unexported fields
}

func (*Response) Code

func (r *Response) Code() string

func (*Response) Type

func (r *Response) Type() string

type SecuritySettings

type SecuritySettings struct {
	// contains filtered or unexported fields
}

func (*SecuritySettings) Definition

func (ss *SecuritySettings) Definition() openapi.SecurityScheme

func (*SecuritySettings) Scopes

func (ss *SecuritySettings) Scopes() []string

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) Calls

func (s *Service) Calls() []*Call

func (*Service) Name

func (s *Service) Name() string

type Struct

type Struct struct {
	// contains filtered or unexported fields
}

func (*Struct) Fields

func (s *Struct) Fields() []*Field

func (*Struct) Name

func (s *Struct) Name() string

func (*Struct) ResolveIncomplete

func (v *Struct) ResolveIncomplete(ctx *compileCtx) (Type, error)

func (*Struct) SetName

func (v *Struct) SetName(s string)

type Type

type Type interface {
	Name() string
	SetName(string)
	ResolveIncomplete(ctx *compileCtx) (Type, error)
}

type TypeDefinition

type TypeDefinition struct {
	Path    string
	Context string
	Type    Type
}

TypeDefinition gives you the context where this type was generated

Jump to

Keyboard shortcuts

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