java

package
v0.0.0-...-d4aa6c0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	String  = "String"
	Boolean = "boolean"
	Integer = "int"
	Object  = "Object"
	List    = "List"
	Float   = "float"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Name    string
	Package string
	Doc     string
	Root    string
	Types   []Class
	Methods []Method
	Globals []Param
}

API holds the java-ready structure of an API definition

type Class

type Class struct {
	Name    string
	Members []Member
	// Optionally, a class can just extend an external class, as defined in the generator.
	Extends    string
	Implements string
}

Class represents a local class definition from a swagger return type schema

type Generator

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

Generator is a code geneator that renders a complete Java client API code from a swagger definition of our API

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new generator and parses the command line arguments

func (*Generator) Generate

func (g *Generator) Generate(swapi *swagger.API) ([]byte, error)

Generate takes a swagger API and compiles a java client from it

type Member

type Member struct {
	Name string
	Type TypeRef
}

Member is a member in a class

type Method

type Method struct {
	Name     string
	Returns  TypeRef
	Params   []Param
	HttpVerb string
	Doc      string
	Path     string
}

Method hodls the mapping of a route to a java method and its parameters

type Param

type Param struct {
	Name     string
	Doc      string
	Type     TypeRef
	In       string
	Required bool
	Global   bool
}

Param is a method parameter

type TypeRef

type TypeRef struct {
	Namespace string
	Type      string
	Contained []TypeRef
}

TypeRef represents the type of a member or a parameter, either to a java type or to a class defined in the API

func (TypeRef) String

func (t TypeRef) String() string

Jump to

Keyboard shortcuts

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