Documentation ¶
Index ¶
Constants ¶
const APIDefinition = `` /* 2908-byte string literal not displayed */
APIDefinition is the template for the go definition of the API.
const Client = `` /* 4185-byte string literal not displayed */
Client is the template for the client of the service.
const Dockerfile = `` /* 520-byte string literal not displayed */
Dockerfile is the template for the service's Dockerfile.
const Env = `package config
import "github.com/kelseyhightower/envconfig"
// Env holds all environmental variables for the service app.
type Env struct {
Port string ` + "`" + `default:"{{.Port}}" envconfig:"PORT"` + "`" + `
{{range .Environment -}}
{{.Name | toLower | capitalize}} {{.Type}} ` + "`" + `default:"{{.Value}}" envconfig:"{{.Name | toUpper}}"` + "`" + `
{{end}}
{{range $d := .Dependencies -}}
{{$d | replaceHyphens | toLower | capitalize}}Addr string ` + "`" + `default:"" envconfig:"{{$d | replaceHyphens | toUpper}}_ADDR"` + "`" + `
{{end}}
}
// ProcessEnv processes the environment, filling an
// Env struct's fields with the found values.
func ProcessEnv() (e Env, err error) {
err = envconfig.Process("app", &e)
return e, err
}`
Env is the template for the environment config in go code.
const Errors = `` /* 399-byte string literal not displayed */
Errors is the template for the go definition of the errors code.
const HTTPErrorHandler = `` /* 296-byte string literal not displayed */
HTTPErrorHandler is the template for the go definition of the HTTP error handler code.
const HTTPRouter = `` /* 1122-byte string literal not displayed */
HTTPRouter is the template for the HTTP router in go code.
const HTTPWrapper = `` /* 4474-byte string literal not displayed */
HTTPWrapper is the template for HTTP boilerplate in go code.
const Impl = `` /* 2753-byte string literal not displayed */
Impl is the template for the main go implementation of the API.
const Main = `` /* 882-byte string literal not displayed */
Main is the template for the main functionality in go code.
const Struct = `package exports
// {{.Name | capitalize}} - generated API structure
type {{.Name | capitalize}} struct {
{{range .Fields}}{{.Name | capitalize}} {{.Type | typeName}} ` + "`" + `json:"{{.Name}}"` + "`" + `
{{end}}
}`
Struct is the template for API structures in go code.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
This section is empty.