api

package
v0.0.0-...-ac2c89b Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Metadata   Metadata
	Operations map[string]*Operation
	Shapes     map[string]*Shape

	// Disables inflection checks. Only use this when generating tests
	NoInflections bool

	// Set to true to avoid removing unused shapes
	NoRemoveUnusedShapes bool

	// Set to true to ignore service/request init methods (for testing)
	NoInitMethods bool
	// contains filtered or unexported fields
}

func Load

func Load(api, docs, paginators, waiters string) *API

func (*API) APIGoCode

func (a *API) APIGoCode() string

func (*API) Attach

func (a *API) Attach(filename string)

func (*API) AttachString

func (a *API) AttachString(str string)

func (*API) ExampleGoCode

func (a *API) ExampleGoCode() string

func (*API) ExportableName

func (a *API) ExportableName(name string) string

func (*API) InterfaceGoCode

func (a *API) InterfaceGoCode() string

Returns the go code for the service's API operations as an interface{}. Assumes that the interface is being created in a different package than the service API's package.

func (*API) InterfacePackageName

func (a *API) InterfacePackageName() string

Returns the package name for the interface.

func (*API) NewAPIGoCodeWithPkgName

func (a *API) NewAPIGoCodeWithPkgName(cfg string) string

Returns a string of instantiating the API prefixed with its package name. Takes a string depicting the Config.

func (*API) NiceName

func (a *API) NiceName() string

func (*API) OperationList

func (a *API) OperationList() []*Operation

func (*API) OperationNames

func (a *API) OperationNames() []string

func (*API) PackageName

func (a *API) PackageName() string

func (*API) ProtocolPackage

func (a *API) ProtocolPackage() string

func (*API) ServiceGoCode

func (a *API) ServiceGoCode() string

func (*API) Setup

func (a *API) Setup()

func (*API) ShapeList

func (a *API) ShapeList() []*Shape

func (*API) ShapeNames

func (a *API) ShapeNames() []string

func (*API) StructName

func (a *API) StructName() string

StructName returns the service struct name for a given service

func (*API) UseInitMethods

func (a *API) UseInitMethods() bool

type HTTPInfo

type HTTPInfo struct {
	Method       string
	RequestURI   string
	ResponseCode uint
}

type Metadata

type Metadata struct {
	APIVersion          string
	EndpointPrefix      string
	ServiceAbbreviation string
	ServiceFullName     string
	SignatureVersion    string
	JSONVersion         string
	TargetPrefix        string
	Protocol            string
}

type Operation

type Operation struct {
	API           *API `json: "-"`
	ExportedName  string
	Name          string
	Documentation string
	HTTP          HTTPInfo
	InputRef      ShapeRef `json:"input"`
	OutputRef     ShapeRef `json:"output"`
}

func (*Operation) Docstring

func (o *Operation) Docstring() string

func (*Operation) Example

func (o *Operation) Example() string

func (*Operation) ExampleInput

func (o *Operation) ExampleInput() string

func (*Operation) GoCode

func (o *Operation) GoCode() string

func (*Operation) HasInput

func (o *Operation) HasInput() bool

func (*Operation) HasOutput

func (o *Operation) HasOutput() bool

func (*Operation) InterfaceSignature

func (o *Operation) InterfaceSignature() string

Returns a string representing the Operation's interface{} functional signature.

type Shape

type Shape struct {
	API           *API `json: "-"`
	ShapeName     string
	Documentation string
	MemberRefs    map[string]*ShapeRef `json:"members"`
	MemberRef     ShapeRef             `json:"member"`
	KeyRef        ShapeRef             `json:"key"`
	ValueRef      ShapeRef             `json:"value"`
	Required      []string
	Payload       string
	Type          string
	Exception     bool
	Enum          []string
	Flattened     bool
	Streaming     bool
	Location      string
	LocationName  string
	XMLNamespace  XMLInfo
	// contains filtered or unexported fields
}

func (*Shape) Docstring

func (s *Shape) Docstring() string

func (*Shape) GoCode

func (s *Shape) GoCode() string

func (*Shape) GoType

func (s *Shape) GoType() string

Returns a shape's Go type

func (*Shape) GoTypeElem

func (s *Shape) GoTypeElem() string

func (*Shape) GoTypeWithPkgName

func (s *Shape) GoTypeWithPkgName() string

Returns a shape's type as a string with the package name in <packageName>.<type> format. package naming only applies to structures.

func (*Shape) IsRequired

func (s *Shape) IsRequired(member string) bool

func (*Shape) MemberNames

func (s *Shape) MemberNames() []string

func (*Shape) Rename

func (s *Shape) Rename(newName string)

type ShapeRef

type ShapeRef struct {
	API           *API   `json: "-"`
	Shape         *Shape `json: "-"`
	Documentation string
	ShapeName     string `json:"shape"`
	Location      string
	LocationName  string
	QueryName     string
	Flattened     bool
	Streaming     bool
	XMLAttribute  bool
	XMLNamespace  XMLInfo
	Payload       string
}

func (*ShapeRef) Docstring

func (ref *ShapeRef) Docstring() string

func (*ShapeRef) GoTags

func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string

func (*ShapeRef) GoType

func (ref *ShapeRef) GoType() string

Returns a shape ref's Go type.

func (*ShapeRef) GoTypeElem

func (ref *ShapeRef) GoTypeElem() string

func (*ShapeRef) GoTypeWithPkgName

func (ref *ShapeRef) GoTypeWithPkgName() string

Returns a shape's type as a string with the package name in <packageName>.<type> format. package naming only applies to structures.

type XMLInfo

type XMLInfo struct {
	Prefix string
	URI    string
}

Jump to

Keyboard shortcuts

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