swagger

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package swagger provides swagger UI resource files for swagger API service.

Should be used with gf cli tool: gf pack public boot/data-packed.go -n boot -p=swagger -y

Index

Constants

View Source
const (
	Name               = "gf-swagger"
	Author             = "john@goframe.org"
	Version            = "v1.0.3"
	Description        = "gf-swagger provides swagger API document feature for GoFrame project. https://github.com/gogf/gf-swagger"
	MaxAuthAttempts    = 10          // Max authentication count for failure try.
	AuthFailedInterval = time.Minute // Authentication retry interval after last failed.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Swagger

type Swagger struct {
	Info          SwaggerInfo // Swagger information.
	Schemes       []string    // Supported schemes of the swagger API like "http", "https".
	Host          string      // The host of the swagger APi like "127.0.0.1", "www.mydomain.com"
	BasicPath     string      // The URI for the swagger API like "/", "v1", "v2".
	BasicAuthUser string      `c:"user"` // HTTP basic authentication username.
	BasicAuthPass string      `c:"pass"` // HTTP basic authentication password.
}

Swagger is the struct for swagger feature management.

func (*Swagger) Author

func (swagger *Swagger) Author() string

Author returns the author of the plugin.

func (*Swagger) Description

func (swagger *Swagger) Description() string

Description returns the description of the plugin.

func (*Swagger) Install

func (swagger *Swagger) Install(s *ghttp.Server) error

Install installs the swagger to server as a plugin. It implements the interface ghttp.Plugin.

func (*Swagger) Name

func (swagger *Swagger) Name() string

Name returns the name of the plugin.

func (*Swagger) Remove

func (swagger *Swagger) Remove() error

Remove uninstalls swagger feature from server.

func (*Swagger) Version

func (swagger *Swagger) Version() string

Version returns the version of the plugin.

type SwaggerInfo

type SwaggerInfo struct {
	Title          string // Title of the swagger API.
	Version        string // Version of the swagger API.
	TermsOfService string // As the attribute name.
	Description    string // Detail description of the swagger API.
}

SwaggerInfo is the information field for swagger.

Jump to

Keyboard shortcuts

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