goswagger

package module
Version: v0.0.0-...-fe43dc0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: BSD-3-Clause Imports: 11 Imported by: 1

README

GO Swagger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

Types

type Config

type Config struct {
	Enabled      bool           `json:"enabled" flag:"swagger-enable" default:"true" description:"enable swagger"`
	Name         string         `json:"name" flag:"swagger-name" default:"go-swagger" description:"swagger name"`
	Url          string         `json:"url" flag:"swagger-url" default:"/apidocs.json"`
	ClientId     string         `json:"clientId"`
	ClientSecret string         `json:"clientSecret"`
	Schemes      []SchemeConfig `json:"schemes"`
	Urls         []struct {
		Name string `json:"name"`
		Url  string `json:"url"`
	} `json:"urls"`
}

func (*Config) Validate

func (p *Config) Validate() error

type SchemeConfig

type SchemeConfig struct {
	Name             string            `json:"name"`
	Type             rest.SecurityType `json:"type" description:"base|apiKey|implicit|password|application|accessCode"`
	FieldName        string            `json:"fieldName" description:"used for apiKey"`
	ValueSource      string            `json:"valueSource" description:"used for apiKey, header|query|cookie"`
	AuthorizationURL string            `json:"authorizationURL" description:"used for OAuth2"`
	TokenURL         string            `json:"tokenURL" description:"used for OAuth2"`
	// contains filtered or unexported fields
}

func (*SchemeConfig) Validate

func (p *SchemeConfig) Validate() error

type Swagger

type Swagger struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config) *Swagger

func (Swagger) Install

func (p Swagger) Install(mux mux) error

func (Swagger) Schemes

func (p Swagger) Schemes() []SchemeConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL