scaffold

package
v0.0.0-...-feedf35 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator generates microservice scaffolds from WADL specifications.

func NewGenerator

func NewGenerator(wadlPath string) (*Generator, error)

NewGenerator creates a new generator from a SEP 2 WADL file. The service name is derived from the WADL filename (without extension).

func (*Generator) Generate

func (g *Generator) Generate() error

Generate creates the complete service scaffold in the current directory.

func (*Generator) ServiceName

func (g *Generator) ServiceName() string

ServiceName returns the service name derived from the WADL filename.

type MethodInfo

type MethodInfo struct {
	FuncName     string
	HTTPMethod   string
	Mode         string
	ResponseType string
	PathParams   []string
	Path         string
}

MethodInfo describes a single handler function.

type ResourceTemplateData

type ResourceTemplateData struct {
	Name    string
	Methods []MethodInfo
}

ResourceTemplateData groups methods under a named resource.

type RouteInfo

type RouteInfo struct {
	HTTPMethod string
	Path       string
	FuncName   string
}

RouteInfo is one http.Handle registration line.

type TemplateData

type TemplateData struct {
	ServiceName     string
	ServiceConstant string
	MaxEntities     int
	Routes          []RouteInfo
	Resources       []ResourceTemplateData
	HasPathParams   bool
}

TemplateData holds all data passed to file-generation templates.

Jump to

Keyboard shortcuts

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