genswagger

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package genswagger contains method for generate swagger config from protobuf file.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version of the generator.
	Version = "v0.0.0-unknown"
	// MethodsWithServiceName specifies that name of methods will be generate with service name.
	MethodsWithServiceName = false
	// GenerateServices service names to generate, all if it empty.
	GenerateServices = []string{}
	// ServiceDescriptionsPath path to json file with service descriptions.
	ServiceDescriptionsPath = ""
	// ServicesVersion sets the version of the services if it is not empty.
	ServicesVersion = ""
	// AllTypes genereates all type from proto files.
	AllTypes = false
	// HideVersions do not prints version of the protoc and protoc-gen-swagger-pjrpc.
	HideVersions = false
)

Some variables as config of generator.

View Source
var (
	// ErrNoServicesInFiles is returned when all proto-files do not contain service directives.
	ErrNoServicesInFiles = errors.New("proto files do not contain services")
	// ErrServiceNotFound is returned when service with required name not found in list service.
	ErrServiceNotFound = errors.New("service not found")
	// ErrInvalidKeyType is returned when key of the map field is wrong.
	ErrInvalidKeyType = errors.New("key of the map should be string or integer")
)

Functions

func Run

func Run(gen *protogen.Plugin) error

Run loops through files to generate and creates spec file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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