Versions in this module Expand all Collapse all v1 v1.7.16 Dec 28, 2019 Changes in this version + var Debug = os.Getenv("DEBUG") != "" || os.Getenv("SWAGGER_DEBUG") != "" + var ExportedAssets = assets + var FuncMap template.FuncMap = map[string]interface + func AddFile(name, data string) error + func Asset(name string) ([]byte, error) + func AssetDir(name string) ([]string, error) + func AssetInfo(name string) (os.FileInfo, error) + func AssetNames() []string + func DefaultSectionOpts(gen *GenOpts) + func GenerateClient(name string, modelNames, operationIDs []string, opts *GenOpts) error + func GenerateDefinition(modelNames []string, opts *GenOpts) error + func GenerateServerOperation(operationNames []string, opts *GenOpts) error + func GenerateSupport(name string, modelNames, operationIDs []string, opts *GenOpts) error + func MustAsset(name string) []byte + func ReadConfig(fpath string) (*viper.Viper, error) + func ReplaceAssets(r map[string][]byte) + func RestoreAsset(dir, name string) error + func RestoreAssets(dir, name string) error + type GenApp struct + APIPackage string + BaseModule string + BasePath string + Consumes GenSerGroups + DefaultConsumes string + DefaultImports []string + DefaultProduces string + ExcludeSpec bool + ExternalDocs *spec.ExternalDocumentation + ExtraSchemes []string + FlatSwaggerJSON string + GenOpts *GenOpts + Host string + Imports map[string]string + Info *spec.Info + Models []GenDefinition + Name string + OperationGroups GenOperationGroups + Operations GenOperations + Package string + Principal string + Produces GenSerGroups + ReceiverName string + Schemes []string + SecurityDefinitions GenSecuritySchemes + SwaggerJSON string + WithContext bool + func GenerateServer(name string, modelNames, operationIDs []string, opts *GenOpts) (*GenApp, error) + func (g *GenApp) UseGoStructFlags() bool + func (g *GenApp) UseIntermediateMode() bool + func (g *GenApp) UseModernMode() bool + func (g *GenApp) UsePFlags() bool + type GenCommon struct + Copyright string + TargetImportPath string + type GenDefinition struct + DefaultImports []string + DependsOn []string + ExtraSchemas GenSchemaList + Imports map[string]string + Package string + func (rt *GenDefinition) Zero() string + type GenDefinitions []GenDefinition + func (g GenDefinitions) Len() int + func (g GenDefinitions) Less(i, j int) bool + func (g GenDefinitions) Swap(i, j int) + type GenHeader struct + Child *GenItems + CollectionFormat string + Converter string + Default interface{} + Description string + Formatter string + HasDefault bool + ID string + IndexVar string + Name string + Package string + Parent *GenItems + Path string + ReceiverName string + Title string + ValueExpression string + ZeroValue string + func (g *GenHeader) ItemsDepth() string + func (rt *GenHeader) Zero() string + type GenHeaders []GenHeader + func (g GenHeaders) HasSomeDefaults() bool + func (g GenHeaders) Len() int + func (g GenHeaders) Less(i, j int) bool + func (g GenHeaders) Swap(i, j int) + type GenItems struct + Child *GenItems + CollectionFormat string + Converter string + Formatter string + IndexVar string + KeyVar string + Location string + Name string + Parent *GenItems + Path string + SkipParse bool + ValueExpression string + func (g *GenItems) ItemsDepth() string + func (rt *GenItems) Zero() string + type GenOperation struct + Authorized bool + BasePath string + ConsumesMediaTypes []string + DefaultImports []string + DefaultResponse *GenResponse + Description string + Extensions map[string]interface{} + ExtraSchemas GenSchemaList + ExtraSchemes []string + FormParams GenParameters + HasBodyParams bool + HasFileParams bool + HasFormParams bool + HasFormValueParams bool + HasHeaderParams bool + HasPathParams bool + HasQueryParams bool + HasStreamingResponse bool + HeaderParams GenParameters + Imports map[string]string + Method string + Name string + Package string + Params GenParameters + Path string + PathParams GenParameters + Principal string + ProducesMediaTypes []string + QueryParams GenParameters + ReceiverName string + Responses GenStatusCodeResponses + RootPackage string + Schemes []string + Security []GenSecurityRequirements + SecurityDefinitions GenSecuritySchemes + SuccessResponse *GenResponse + SuccessResponses []GenResponse + Summary string + Tags []string + TimeoutName string + WithContext bool + type GenOperationGroup struct + BaseModule string + DefaultImports []string + Description string + GenOpts *GenOpts + Imports map[string]string + Name string + NoOperationHeader bool + Operations GenOperations + ParentName string + RootPackage string + Summary string + WithContext bool + type GenOperationGroups []GenOperationGroup + func (g GenOperationGroups) Len() int + func (g GenOperationGroups) Less(i, j int) bool + func (g GenOperationGroups) Swap(i, j int) + type GenOperations []GenOperation + func (g GenOperations) Len() int + func (g GenOperations) Less(i, j int) bool + func (g GenOperations) Swap(i, j int) + type GenOpts struct + APIPackage string + ClientPackage string + CompatibilityMode string + Copyright string + DefaultConsumes string + DefaultProduces string + DefaultScheme string + DryRun bool + DumpData bool + ExcludeSpec bool + ExistingModels string + FlagStrategy string + FlattenOpts *analysis.FlattenOpts + Imports map[string]string + IncludeHandler bool + IncludeMain bool + IncludeModel bool + IncludeParameters bool + IncludeResponses bool + IncludeSupport bool + IncludeURLBuilder bool + IncludeValidator bool + IsClient bool + LanguageOpts *LanguageOpts + ModelPackage string + Models []string + Name string + Operations []string + Principal string + RegenerateConfigureAPI bool + Sections SectionOpts + ServerPackage string + Spec string + Tags []string + Target string + Template string + TemplateDir string + Templates map[string][]byte + TypeMapping map[string]string + ValidateSpec bool + WithContext bool + func (g *GenOpts) EnsureDefaults() error + func (g *GenOpts) SpecPath() string + func (g *GenOpts) TargetPath() string + type GenParameter struct + AllowEmptyValue bool + Child *GenItems + CollectionFormat string + Converter string + Default interface{} + Description string + Extensions map[string]interface{} + Formatter string + HasDefault bool + HasModelBodyItems bool + HasModelBodyMap bool + HasModelBodyParams bool + HasSimpleBodyItems bool + HasSimpleBodyMap bool + HasSimpleBodyParams bool + ID string + IndexVar string + KeyVar string + Location string + ModelsPackage string + Name string + Parent *GenItems + Path string + ReceiverName string + Schema *GenSchema + Title string + ValueExpression string + ZeroValue string + func (g *GenParameter) IsBodyParam() bool + func (g *GenParameter) IsFileParam() bool + func (g *GenParameter) IsFormParam() bool + func (g *GenParameter) IsHeaderParam() bool + func (g *GenParameter) IsJsonParam() bool + func (g *GenParameter) IsPathParam() bool + func (g *GenParameter) IsQueryParam() bool + func (g *GenParameter) ItemsDepth() string + func (rt *GenParameter) Zero() string + type GenParameters []GenParameter + func (g GenParameters) HasSomeDefaults() bool + func (g GenParameters) Len() int + func (g GenParameters) Less(i, j int) bool + func (g GenParameters) Swap(i, j int) + type GenResponse struct + AllowsForStreaming bool + Code int + DefaultImports []string + Description string + Extensions map[string]interface{} + Headers GenHeaders + Imports map[string]string + IsSuccess bool + Method string + ModelsPackage string + Name string + Package string + Path string + ReceiverName string + Schema *GenSchema + type GenSchema struct + AdditionalItems *GenSchema + AdditionalProperties *GenSchema + AllOf GenSchemaList + AllowsAdditionalItems bool + CustomTag string + Default interface{} + Description string + Discriminates map[string]string + DiscriminatorField string + DiscriminatorValue string + Example string + HasAdditionalItems bool + HasAdditionalProperties bool + HasBaseType bool + IncludeModel bool + IncludeValidator bool + IndexVar string + IsAdditionalProperties bool + IsBaseType bool + IsExported bool + IsSubType bool + IsVirtual bool + Items *GenSchema + JSONName string + KeyVar string + Location string + Name string + Object *GenSchema + OriginalName string + Parents []string + Path string + Properties GenSchemaList + ReadOnly bool + ReceiverName string + Suffix string + Title string + ValueExpression string + XMLName string + func (rt *GenSchema) Zero() string + type GenSchemaList []GenSchema + func (g GenSchemaList) Len() int + func (g GenSchemaList) Less(i, j int) bool + func (g GenSchemaList) Swap(i, j int) + type GenSecurityRequirement struct + Name string + Scopes []string + type GenSecurityRequirements []GenSecurityRequirement + func (g GenSecurityRequirements) Len() int + func (g GenSecurityRequirements) Less(i, j int) bool + func (g GenSecurityRequirements) Swap(i, j int) + type GenSecurityScheme struct + AppName string + AuthorizationURL string + Description string + Extensions map[string]interface{} + Flow string + ID string + In string + IsAPIKeyAuth bool + IsBasicAuth bool + IsOAuth2 bool + Name string + Principal string + ReceiverName string + Scopes []string + Source string + TokenURL string + Type string + type GenSecuritySchemes []GenSecurityScheme + func (g GenSecuritySchemes) Len() int + func (g GenSecuritySchemes) Less(i, j int) bool + func (g GenSecuritySchemes) Swap(i, j int) + type GenSerGroup struct + AllSerializers GenSerializers + AppName string + Implementation string + MediaType string + Name string + ReceiverName string + type GenSerGroups []GenSerGroup + func (g GenSerGroups) Len() int + func (g GenSerGroups) Less(i, j int) bool + func (g GenSerGroups) Swap(i, j int) + type GenSerializer struct + AppName string + Implementation string + MediaType string + Name string + ReceiverName string + type GenSerializers []GenSerializer + func (g GenSerializers) Len() int + func (g GenSerializers) Less(i, j int) bool + func (g GenSerializers) Swap(i, j int) + type GenStatusCodeResponses []GenResponse + func (g *GenStatusCodeResponses) UnmarshalJSON(data []byte) error + func (g GenStatusCodeResponses) Len() int + func (g GenStatusCodeResponses) Less(i, j int) bool + func (g GenStatusCodeResponses) MarshalJSON() ([]byte, error) + func (g GenStatusCodeResponses) Swap(i, j int) + type LanguageConfig map[string]LanguageDefinition + type LanguageDefinition struct + Layout SectionOpts + func (d *LanguageDefinition) ConfigureOpts(opts *GenOpts) error + type LanguageOpts struct + BaseImportFunc func(string) string + ReservedWords []string + func GoLangOpts() *LanguageOpts + func (l *LanguageOpts) FormatContent(name string, content []byte) ([]byte, error) + func (l *LanguageOpts) Init() + func (l *LanguageOpts) MangleFileName(name string) string + func (l *LanguageOpts) MangleName(name, suffix string) string + func (l *LanguageOpts) MangleVarName(name string) string + type Repository struct + func NewRepository(funcs template.FuncMap) *Repository + func (t *Repository) AddFile(name, data string) error + func (t *Repository) DumpTemplates() + func (t *Repository) Get(name string) (*template.Template, error) + func (t *Repository) LoadContrib(name string) error + func (t *Repository) LoadDefaults() + func (t *Repository) LoadDir(templatePath string) error + func (t *Repository) MustGet(name string) *template.Template + func (t *Repository) OverrideTemplate(name, data string) error + type SectionOpts struct + Application []TemplateOpts + Models []TemplateOpts + OperationGroups []TemplateOpts + Operations []TemplateOpts + type TemplateOpts struct + FileName string + Name string + SkipExists bool + SkipFormat bool + Source string + Target string Other modules containing this package gitlab.com/ModelRocket/hiro/v2