swagger

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Examples

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
}

func New

func New(title, ver, desc string) *Generator

func (*Generator) WithTag

func (sg *Generator) WithTag(tagName string) *Generator

func (*Generator) WritePostmanTo added in v0.10.0

func (sg *Generator) WritePostmanTo(w io.Writer, descs ...desc.ServiceDesc) error

func (*Generator) WritePostmanToFile added in v0.10.0

func (sg *Generator) WritePostmanToFile(filename string, services ...desc.ServiceDesc) error
Example
err := swagger.New("TestTitle", "v0.0.1", "").
	WithTag("json").
	WritePostmanToFile("_postman.json", testService{})
fmt.Println(err)
Output:

<nil>

func (*Generator) WriteSwagTo added in v0.10.0

func (sg *Generator) WriteSwagTo(w io.Writer, descs ...desc.ServiceDesc) error

func (*Generator) WriteSwagToFile added in v0.10.0

func (sg *Generator) WriteSwagToFile(filename string, services ...desc.ServiceDesc) error
Example
err := swagger.New("TestTitle", "v0.0.1", "").
	WithTag("json").
	WriteSwagToFile("_swagger.json", testService{})
fmt.Println(err)
Output:

<nil>

Jump to

Keyboard shortcuts

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