swagger

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClientNotImplemented = errors.New("client option is not implemented yet")
View Source
var ErrGenTypeUndefined = errors.New("generation type is undefined. Must be: server/models/client`")
View Source
var ErrNilCfgModelsOpts = errors.New(" value: `Models` in your config_swagger is nil")
View Source
var ErrNilCfgServerOpts = errors.New(" value: `Server` in your config_swagger is nil")
View Source
var ErrNilGenerationPathOrOutput = errors.New("spec file path AND/OR generation output path are nil")

Functions

func BytesFromFile

func BytesFromFile(path string) []byte

func GenMod

func GenMod(cfg, generatePath string) (*generate.Model, error)

func GenServer

func GenServer(cfg, generatePath string) (*generate.Server, error)

func GetHandlerOutputName added in v0.0.3

func GetHandlerOutputName(operID, restMethod string) string

func GoFiles

func GoFiles(pathPart string) []string

func OperationCheck added in v0.0.3

func OperationCheck(oper *spec.Operation) bool

func OperationsPath added in v0.0.4

func OperationsPath(part string) string

func ParseOperations added in v0.0.3

func ParseOperations(pathItem spec.PathItem, operationalPath string) *models.Operation

func RemoveDupes added in v0.0.4

func RemoveDupes(sliceToCheck []string) []string

func SpecParser added in v0.0.3

func SpecParser(path string) (*spec.Swagger, error)

Types

type GenerationType

type GenerationType int
const (
	ServerGen GenerationType = iota
	ModelsGen
	ClientGen // TODO

)

func ParseGenType

func ParseGenType(s string) GenerationType

func (GenerationType) String

func (s GenerationType) String() string

type IDummy added in v0.0.3

type IDummy interface {
	GetHandlersModel() *models.Handlers
	Call(cfg string) error
}

func NewDummy added in v0.0.3

func NewDummy() IDummy

type ISwagger

type ISwagger interface {
	Generate(genType string) error
}

func NewSwagger

func NewSwagger(cfg *config_swagger.SwaggerCfg) ISwagger

Jump to

Keyboard shortcuts

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