generate

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name            string   `long:"name" short:"A" description:"the name of the application, defaults to a mangled value of info.title"`
	Operations      []string `long:"operation" short:"O" description:"specify an operation to include, repeat for multiple"`
	Tags            []string `long:"tags" description:"the tags to include, if not specified defaults to all"`
	Principal       string   `long:"principal" short:"P" description:"the model to use for the security principal"`
	Models          []string `long:"model" short:"M" description:"specify a model to include, repeat for multiple"`
	DefaultScheme   string   `long:"default-scheme" description:"the default scheme for this client" default:"http"`
	DefaultProduces string   `long:"default-produces" description:"the default mime type that API operations produce" default:"application/json"`
	SkipModels      bool     `long:"skip-models" description:"no models will be generated when this flag is specified"`
	SkipOperations  bool     `long:"skip-operations" description:"no operations will be generated when this flag is specified"`
	DumpData        bool     `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"`
	SkipValidation  bool     `long:"skip-validation" description:"skips validation of spec prior to generation"`
	// contains filtered or unexported fields
}

Client the command to generate a swagger client

func (*Client) Execute

func (c *Client) Execute(args []string) error

Execute runs this command

type FlattenCmdOptions added in v0.17.0

type FlattenCmdOptions struct {
	WithExpand  bool     `long:"with-expand" description:"expands all $ref's in spec prior to generation (shorthand to --with-flatten=expand)"`
	WithFlatten []string `` /* 223-byte string literal not displayed */
}

FlattenCmdOptions determines options to the flatten spec preprocessing

func (*FlattenCmdOptions) SetFlattenOptions added in v0.17.0

func (f *FlattenCmdOptions) SetFlattenOptions(dflt *analysis.FlattenOpts) (res *analysis.FlattenOpts)

SetFlattenOptions builds flatten options from command line args

type Model

type Model struct {
	Name           []string `long:"name" short:"n" description:"the model to generate"`
	NoStruct       bool     `long:"skip-struct" description:"when present will not generate the model struct"`
	DumpData       bool     `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"`
	SkipValidation bool     `long:"skip-validation" description:"skips validation of spec prior to generation"`
	// contains filtered or unexported fields
}

Model the generate model file command

func (*Model) Execute

func (m *Model) Execute(args []string) error

Execute generates a model file

type Operation

type Operation struct {
	Name           []string `long:"name" short:"n" required:"true" description:"the operations to generate, repeat for multiple"`
	Tags           []string `long:"tags" description:"the tags to include, if not specified defaults to all"`
	Principal      string   `short:"P" long:"principal" description:"the model to use for the security principal"`
	DefaultScheme  string   `long:"default-scheme" description:"the default scheme for this API" default:"http"`
	NoHandler      bool     `long:"skip-handler" description:"when present will not generate an operation handler"`
	NoStruct       bool     `long:"skip-parameters" description:"when present will not generate the parameter model struct"`
	NoResponses    bool     `long:"skip-responses" description:"when present will not generate the response model struct"`
	NoURLBuilder   bool     `long:"skip-url-builder" description:"when present will not generate a URL builder"`
	DumpData       bool     `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"`
	SkipValidation bool     `long:"skip-validation" description:"skips validation of spec prior to generation"`
	// contains filtered or unexported fields
}

Operation the generate operation files command

func (*Operation) Execute

func (o *Operation) Execute(args []string) error

Execute generates a model file

type Server

type Server struct {
	Name                   string   `long:"name" short:"A" description:"the name of the application, defaults to a mangled value of info.title"`
	Operations             []string `long:"operation" short:"O" description:"specify an operation to include, repeat for multiple"`
	Tags                   []string `long:"tags" description:"the tags to include, if not specified defaults to all"`
	Principal              string   `long:"principal" short:"P" description:"the model to use for the security principal"`
	DefaultScheme          string   `long:"default-scheme" description:"the default scheme for this API" default:"http"`
	Models                 []string `long:"model" short:"M" description:"specify a model to include, repeat for multiple"`
	SkipModels             bool     `long:"skip-models" description:"no models will be generated when this flag is specified"`
	SkipOperations         bool     `long:"skip-operations" description:"no operations will be generated when this flag is specified"`
	SkipSupport            bool     `long:"skip-support" description:"no supporting files will be generated when this flag is specified"`
	ExcludeMain            bool     `long:"exclude-main" description:"exclude main function, so just generate the library"`
	ExcludeSpec            bool     `long:"exclude-spec" description:"don't embed the swagger specification"`
	WithContext            bool     `long:"with-context" description:"handlers get a context as first arg (deprecated)"`
	DumpData               bool     `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"`
	FlagStrategy           string   `` /* 131-byte string literal not displayed */
	CompatibilityMode      string   `` /* 136-byte string literal not displayed */
	SkipValidation         bool     `long:"skip-validation" description:"skips validation of spec prior to generation"`
	RegenerateConfigureAPI bool     `long:"regenerate-configureapi" description:"Force regeneration of configureapi.go"`
	// contains filtered or unexported fields
}

Server the command to generate an entire server application

func (*Server) Execute

func (s *Server) Execute(args []string) error

Execute runs this command

type SpecFile

type SpecFile struct {
	BasePath    string         `long:"base-path" short:"b" description:"the base path to use" default:"."`
	BuildTags   string         `long:"tags" short:"t" description:"build tags" default:""`
	ScanModels  bool           `long:"scan-models" short:"m" description:"includes models that were annotated with 'swagger:model'"`
	Compact     bool           `long:"compact" description:"when present, doesn't prettify the json"`
	Output      flags.Filename `long:"output" short:"o" description:"the file to write to"`
	Input       flags.Filename `long:"input" short:"i" description:"the file to use as input"`
	Include     []string       `long:"include" short:"c" description:"include packages matching pattern"`
	Exclude     []string       `long:"exclude" short:"x" description:"exclude packages matching pattern"`
	IncludeTags []string       `long:"include-tag" short:"" description:"include routes having specified tags (can be specified many times)"`
	ExcludeTags []string       `long:"exclude-tag" short:"" description:"exclude routes having specified tags (can be specified many times)"`
}

SpecFile command to generate a swagger spec from a go application

func (*SpecFile) Execute

func (s *SpecFile) Execute(args []string) error

Execute runs this command

type Support

type Support struct {
	Name          string   `long:"name" short:"A" description:"the name of the application, defaults to a mangled value of info.title"`
	Operations    []string `long:"operation" short:"O" description:"specify an operation to include, repeat for multiple"`
	Principal     string   `long:"principal" description:"the model to use for the security principal"`
	Models        []string `long:"model" short:"M" description:"specify a model to include, repeat for multiple"`
	DumpData      bool     `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"`
	DefaultScheme string   `long:"default-scheme" description:"the default scheme for this API" default:"http"`
	// contains filtered or unexported fields
}

Support generates the supporting files

func (*Support) Execute

func (s *Support) Execute(args []string) error

Execute generates the supporting files file

Jump to

Keyboard shortcuts

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