swago

package module
v0.0.0-...-5ab778b Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Unlicense Imports: 15 Imported by: 0

README

Swago

Autogenerate the swagger documentation for your services

Golangci report

Wait what?

By reading the ast of your source files, swago attempts to extract the routes, the handlers of each route, the request and response model

How does it perform such magic

Well, it is not THAT magic, but it is quite cool. By reading a config file, it will search for certain patterns in order to extract routes, handlers, request and response models.

It will search in every function of the project for patterns and autogenerate the swagger.yml file for you. As a developer, you only need to follow the same patterns over and over again, which is quite common in GO.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SwaggerGenerator

type SwaggerGenerator struct {
	Blacklist     []*regexp.Regexp
	Pkgs          []*pkg.Pkg
	ModuleName    string
	VendorFolders []string

	RootPath string
	GoPath   string
	// contains filtered or unexported fields
}

SwaggerGenerator is able to navigate a project's code

func NewSwaggerGenerator

func NewSwaggerGenerator(rootPath, goPath string, vendorFolders []string, logger *log.Logger) (*SwaggerGenerator, error)

NewSwaggerGenerator creates a swagger generator that scans a whole project

func NewSwaggerGeneratorWithBlacklist

func NewSwaggerGeneratorWithBlacklist(rootPath, goPath string, vendorFolders []string, logger *log.Logger, blacklist []*regexp.Regexp) (*SwaggerGenerator, error)

NewSwaggerGeneratorWithBlacklist creates a swagger generator that scans a whole project except for any matching a given blacklist

func (*SwaggerGenerator) GenerateSwaggerDoc

func (s *SwaggerGenerator) GenerateSwaggerDoc(projectCriterias criteria.Criteria, swagger *openapi2.Swagger) error

GenerateSwaggerDoc generates the swagger documentation

Directories

Path Synopsis
cmd
encoding
v2
pkg

Jump to

Keyboard shortcuts

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