swaggerctl

package
v0.0.0-...-f5c7691 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStaticDirectoryRoute

func AddStaticDirectoryRoute(server chi.Router, relativeFilesystemPath string, uriPath string)

serve static files from a directory via a chi router

inspired by https://github.com/go-chi/chi/blob/master/_examples/fileserver/main.go

parameters:

  • relativeFilesystemPath where to find the file(s) to serve relative to the current working directory example: "third_party/swagger_ui" note: do NOT add a trailing slash
  • uriPath under which sub-url they should be served, if you leave out trailing slash, also adds a redirect example: "/swagger-ui"

func AddStaticHttpFilesystemRoute

func AddStaticHttpFilesystemRoute(server chi.Router, fs http.FileSystem, uriPath string)

serve static files from an http.FileSystem instance via a chi router

inspired by https://github.com/go-chi/chi/blob/master/_examples/fileserver/main.go

parameters:

  • uriPath under which sub-url they should be served, if you leave out trailing slash, also adds a redirect example: "/swagger-ui"

func AddStaticSingleFileRoute

func AddStaticSingleFileRoute(server chi.Router, relativeFilesystemPath string, uriPath string, filename string)

serve a single static file via a chi router

parameters:

  • relativeFilesystemPath where to find the file(s) to serve relative to the current working directory example: "docs" note: do NOT add a trailing slash
  • uriPath under which sub-url they should be served example: "/"
  • filename which exact file to serve. This will be added to the route, so only exactly this file is made available example: "swagger.json"

func SetupSwaggerRoutes

func SetupSwaggerRoutes(server chi.Router)

Types

This section is empty.

Jump to

Keyboard shortcuts

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