service

package
v0.0.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEditor

func NewEditor(config *EditorConfig) *http.Server

NewEditor creates a new editor

func NewViewer

func NewViewer(config *ViewerConfig) *http.Server

NewViewer creates a new viewer

Types

type CompositeGenerator

type CompositeGenerator []SyntaxGenerator

CompositeGenerator represents a composite generator

func (CompositeGenerator) Generate

func (items CompositeGenerator) Generate(spec *codedom.SpecDescriptor) error

Generate generates the source code

type Editor

type Editor struct {
	Path string
}

Editor edits the swagger file

func (*Editor) Mount

func (e *Editor) Mount(r chi.Router)

Mount mounts the editor

type EditorConfig

type EditorConfig struct {
	Addr string
	Path string
}

EditorConfig represents the editor config

type Generator

type Generator struct {
	Path      string
	Generator SyntaxGenerator
	Resolver  SpecResolver
}

Generator generates the code

func (*Generator) Generate

func (g *Generator) Generate() error

Generate generates the source code

type SpecResolver

type SpecResolver interface {
	// Resolve resolves the spec
	Resolve(spec *openapi3.Swagger) (*codedom.SpecDescriptor, error)
}

SpecResolver resolves the spec

type SyntaxGenerator

type SyntaxGenerator interface {
	// Generate generates a source code from spec
	Generate(spec *codedom.SpecDescriptor) error
}

SyntaxGenerator generates the code

type Validator

type Validator struct {
	Path     string
	Reporter contract.Reporter
}

Validator validates a spec file

func (*Validator) Validate

func (v *Validator) Validate() error

Validate validates the file

type Viewer

type Viewer struct {
	Path string
}

Viewer views the swagger file

func (*Viewer) Mount

func (e *Viewer) Mount(r chi.Router)

Mount mounts the editor

type ViewerConfig

type ViewerConfig struct {
	Addr string
	Path string
}

ViewerConfig represents the viewer config

Jump to

Keyboard shortcuts

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