genjs

package
v0.0.0-...-3014a84 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package genjs provides a goa generator for a javascript client module. The module exposes functions for calling the API actions. It relies on the axios (https://github.com/mzabriskie/axios) javascript library to perform the actual HTTP requests.

The generator also produces an example controller and index HTML that shows how to use the module. The controller simply serves all the files under the "js" directory so that loading "/js" in a browser triggers the example code.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Timeout is the request timeout before it gets aborted.
	Timeout time.Duration

	// Scheme is the URL scheme used to make requests to the API.
	Scheme string

	// Host is the API hostname.
	Host string
)

Functions

func Generate

func Generate(api *design.APIDefinition) ([]string, error)

Generate is the generator entry point called by the meta generator.

Types

type Command

type Command struct {
	*codegen.BaseCommand
}

Command is the goa application code generator command line data structure. It implements meta.Command.

func NewCommand

func NewCommand() *Command

NewCommand instantiates a new command.

func (*Command) RegisterFlags

func (c *Command) RegisterFlags(r codegen.FlagRegistry)

RegisterFlags registers the command line flags with the given registry.

func (*Command) Run

func (c *Command) Run() ([]string, error)

Run simply calls the meta generator.

type Generator

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

Generator is the application code generator.

func NewGenerator

func NewGenerator() (*Generator, error)

NewGenerator returns the application code generator.

func (*Generator) Cleanup

func (g *Generator) Cleanup()

Cleanup removes all the files generated by this generator during the last invokation of Generate.

func (*Generator) Generate

func (g *Generator) Generate(api *design.APIDefinition) (_ []string, err error)

Generate produces the skeleton main.

Jump to

Keyboard shortcuts

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