swagger

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 5 Imported by: 0

README

swagger

This is for swaggo extension library to set extra variables.

go get github.com/worldline-go/utility/swagger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInfo

func SetInfo(opts ...Option) error

Types

type Option

type Option func(*options)

func WithBasePath

func WithBasePath(basePath string) Option

WithBasePath sets the base path of the API.

func WithCustom

func WithCustom(custom map[string]interface{}) Option

WithCustom sets the custom data to be used in the swagger template.

Access custom data in the template with {{.Custom.key}}.

func WithDelims

func WithDelims(delims string) Option

WithDelims sets the delimiters to be used in the SetInfo function.

The default delimiters are "[[ ]]"

func WithDescription

func WithDescription(description string) Option

WithDescription sets the description of the API.

func WithHost

func WithHost(host string) Option

WithHost sets the host of the API.

func WithInfoInstanceName

func WithInfoInstanceName(infoInstanceName string) Option

WithInfoInstanceName sets the name of the swagger instance to be used.

The default name is "swagger".

func WithSchemes

func WithSchemes(schemes ...string) Option

WithSchemes sets the schemes of the API.

func WithTitle

func WithTitle(title string) Option

WithTitle sets the title of the API.

func WithVersion

func WithVersion(version string) Option

WithVersion sets the version of the API.

Jump to

Keyboard shortcuts

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