specification

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseURLFromRequest

func BaseURLFromRequest(r *http.Request) *url.URL

func ContentTypeFromFilename

func ContentTypeFromFilename(name string) string

func NopSeekCloser

func NopSeekCloser(r io.ReadSeeker) io.ReadSeekCloser

Types

type CompiledFile

type CompiledFile struct {
	Contents *bytes.Buffer
	Info     fs.FileInfo
}

type Config

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

type Option

type Option func(*Config)

func WithIndexFilePath

func WithIndexFilePath(indexFilePath string) Option

WithIndexFilePath Sets another path to where files for swagger ui is located

func WithOpenAPIPath

func WithOpenAPIPath(openAPIPath string) Option

WithOpenAPIPath Sets another name for index file than index.html

func WithSwaggerInitJSPath added in v0.14.0

func WithSwaggerInitJSPath(swaggerInitJSPath string) Option

WithSwaggerInitJSPath Sets a path for swagger-initializer.js. This is required for using swagger >= 4.0.0

func WithSwaggerUIDirectory

func WithSwaggerUIDirectory(swaggerUIDirectory string) Option

WithSwaggerUIDirectory Sets another base path for the swagger endpoints

type SwaggerFS

type SwaggerFS struct {
	FS fs.FS

	SwaggerURLPrefix      string
	APIEndpointsURLPrefix string

	NotFoundHandler         http.Handler
	MethodNotAllowedHandler http.Handler
}

func (*SwaggerFS) Handler

func (swaggerfs *SwaggerFS) Handler(opts ...Option) http.Handler

Jump to

Keyboard shortcuts

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