types

package
v0.0.0-...-4799e85 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTPRequest defines an HTTP request
	HTTPRequest = iota

	// HTTPResponse defines an HTTP response
	HTTPResponse
)

Variables

This section is empty.

Functions

func AllTypes

func AllTypes(apiDef *raml.APIDefinition, pkgName string) map[string]TypeTask

AllTypes returns all TypeTask that need to be generated by the code generator

func PascalCaseTypeName

func PascalCaseTypeName(tip TypeInBody) string

PascalCaseTypeName generates pascalcase type name from snackcase method name

Types

type Endpoint

type Endpoint struct {
	Addr     string // complete endpoint address
	Method   *raml.Method
	Resource *raml.Resource
	Verb     string
}

Endpoint represents an endpoint defined in the RAML specs

func (Endpoint) ResourceName

func (ep Endpoint) ResourceName() string

ResourceName returns resource name of an endpoint

type TypeInBody

type TypeInBody struct {
	Properties  map[string]interface{}
	Description string
	Endpoint    *Endpoint
	ReqResp     int
	RespCode    raml.HTTPCode
}

TypeInBody represents a Type that defined inline in the body

func (*TypeInBody) Body

func (tib *TypeInBody) Body() raml.Bodies

Body returns raml.Bodies from TypeInBody object

type TypeTask

type TypeTask struct {
	Type interface{}
	Name string
	Pkg  string
}

TypeTask defines a type generation task

Jump to

Keyboard shortcuts

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