hsup

package module
v0.0.0-...-5c2b6f9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MIT Imports: 1 Imported by: 0

README

go-hsup

Generate scaffold web app from JSON Hyper Schema files

Synopsis

Generate net/http flavored server code

hsup -s /path/to/hyper-schema.json -f nethttp

Generate http.Client based client code

hsup -s /path/to/hyper-schema.json -f httpclient

Generate both the net/http based server and the http client

hsup -s /path/to/hyper-schema.json -f nethttp -f httpclient

JSON Schema Additions

Keys starting with hsup. are custom properties for hsup.

Key Type Description
hsup.client object When specified at the top level, this is used to grab hints for generating client code
hsup.client.imports array(sring) Specifies the list of additional code to import
hsup.server object When specified at the top level, this is used to grab hints for generating server code
hsup.server.imports array(sring) Specifies the list of additional code to import
hsup.type string When specified within a link schema or targetSchema, this type is used to Marshal/Unmarshal data
hsup.wrapper string, arrray(string) When specified within a link, the named function is used to wrap the HandleFunc. The signature for the wrapper must be func(http.HandleFunc) http.HandleeFunc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Dir       string `short:"d" long:"dir" required:"true" description:"Directory to place all files under"`
	PkgPath   string
	AppPkg    string   `short:"a" long:"apppkg" description:"Application package name"`
	Schema    string   `short:"s" long:"schema" required:"true" description:"schema file to process"`
	Flavor    []string `` /* 126-byte string literal not displayed */
	Overwrite bool     `short:"O" long:"overwrite" description:"overwrite if file exists"`
	GoVersion string   `short:"g" long:"goversion" description:"Go version to assume" default:"1.7"`
	Args      []string // left over arguments
}

type Processor

type Processor interface {
	Process(*hschema.HyperSchema) error
	ProcessFile(string) error
}

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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