Documentation ¶
Index ¶
- func RemoveCommentSection(line string) (string, bool)
- type Config
- type InputParameter
- type Method
- type NameType
- type Operation
- type OperationResponse
- type PathsHolder
- type RouteHolder
- type RouteParser
- type RouteParserHolder
- type RoutePath
- type SchemaParameters
- type SchemeHolder
- type SchemeInformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveCommentSection ¶
Types ¶
type InputParameter ¶
type InputParameter struct { Type string `json:"type,omitempty" yaml:"type,omitempty"` Name string `json:"name"` Description string `json:"description"` QueryType string `json:"in" yaml:"in"` Schema SchemaParameters `json:"schema,omitempty" yaml:"schema,omitempty"` Required bool `json:"required,omitempty" yaml:"required,omitempty"` }
type Operation ¶
type Operation struct { Parameters []InputParameter `json:"parameters"` ID string `json:"operationId" yaml:"operationId"` Summary string `json:"summary"` Tags []string `json:"tags"` Responses map[string]OperationResponse `json:"responses"` Consumes []string `json:"consumes,omitempty" yaml:"consumes,omitempty"` }
type OperationResponse ¶ added in v1.4.0
type OperationResponse struct {
Description string `json:"description,omitempty" yaml:"description,omitempty"`
}
type PathsHolder ¶
type RouteHolder ¶
type RouteHolder struct { ID int Path []NameType Query []NameType Body NameType FormData []NameType Route string Methods []string Name string }
func GetInfoFromRouter ¶
func GetInfoFromRouter(r *mux.Router) (holders []RouteHolder, err error)
type RouteParser ¶
type RouteParserHolder ¶ added in v1.4.0
type RouteParserHolder struct { ID int // contains filtered or unexported fields }
type SchemaParameters ¶
type SchemaParameters struct { Type string `json:"type"` Items *SchemaParameters `json:"items,omitempty" yaml:"items,omitempty"` Properties map[string]SchemaParameters `json:"properties,omitempty" yaml:"properties,omitempty"` }
type SchemeHolder ¶
type SchemeHolder struct { SwaggerVersion string `json:"swagger" yaml:"swagger"` Information SchemeInformation `json:"info" yaml:"info"` Host string `json:"host,omitempty" yaml:"host,omitempty"` BasePath string `json:"basePath" yaml:"basePath"` Schemes []string `json:"schemes"` Paths PathsHolder `json:"paths"` }
func (*SchemeHolder) GenerateSwaggerJson ¶ added in v1.4.0
func (s *SchemeHolder) GenerateSwaggerJson(routes []RouteHolder, filePath string) (err error)
func (*SchemeHolder) GenerateSwaggerYaml ¶ added in v1.4.0
func (s *SchemeHolder) GenerateSwaggerYaml(routes []RouteHolder, filePath string) (err error)
type SchemeInformation ¶ added in v1.4.0
Click to show internal directories.
Click to hide internal directories.