service

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Express = "express"
View Source
var Koa = "koa"
View Source
var Servers = []string{Express, Koa}

Functions

func GenerateOperationResponse added in v2.2.0

func GenerateOperationResponse(w *writer.Writer, operation *spec.NamedOperation)

func GenerateService

func GenerateService(specification *spec.Spec, swaggerPath string, generatePath string, servicesPath string, server string, validationName string) *generator.Sources

func New added in v2.2.0

func New(response *spec.Response, body string) string

func ResponseType added in v2.2.0

func ResponseType(operation *spec.NamedOperation, servicePackage string) string

Types

type Generator added in v2.2.0

type Generator struct {
	validations.Validation
	ServiceGenerator
	Modules *Modules
}

func NewServiceGenerator

func NewServiceGenerator(server, validationName string, modules *Modules) *Generator

func (*Generator) ParamsStaticCode added in v2.2.0

func (g *Generator) ParamsStaticCode() *generator.CodeFile

func (*Generator) ServiceApis added in v2.2.0

func (g *Generator) ServiceApis(version *spec.Version) []generator.CodeFile

func (*Generator) ServicesImpls added in v2.2.0

func (g *Generator) ServicesImpls(specification *spec.Spec) []generator.CodeFile

type Modules added in v2.2.0

type Modules struct {
	modules.Modules

	Root       module.Module
	Params     module.Module
	Errors     module.Module
	Responses  module.Module
	SpecRouter module.Module
	// contains filtered or unexported fields
}

func NewModules added in v2.2.0

func NewModules(validationName, generatePath, servicesPath string, specification *spec.Spec) *Modules

func (*Modules) Routing added in v2.2.0

func (m *Modules) Routing(version *spec.Version) module.Module

func (*Modules) ServiceApi added in v2.2.0

func (m *Modules) ServiceApi(api *spec.Api) module.Module

func (*Modules) ServiceImpl added in v2.2.0

func (m *Modules) ServiceImpl(api *spec.Api) module.Module

type ServiceGenerator

type ServiceGenerator interface {
	VersionRouting(version *spec.Version) *generator.CodeFile
	SpecRouter(specification *spec.Spec) *generator.CodeFile
	Responses() *generator.CodeFile
}

Jump to

Keyboard shortcuts

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