doc

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanAndCheckURL

func CleanAndCheckURL(url string) (string, error)

CleanAndCheckURL returns cleaned URL but also an error if given url contains variables that can't be cleaned. Ex: /myresource/{permMyresourceID} should be transformed to /myresource/<myresource-id>, an error will be returned if permMyResourceID not converted.

func CleanURL

func CleanURL(url string) string

CleanURL given a URL with declared variable inside, returns the same URL with harmonized variable names. Ex: permProjectKey -> projectKey

func CleanURLParameter

func CleanURLParameter(u string) string

func GenMarkdownCustom

func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error

GenMarkdownCustom creates custom markdown output.

func GenerateDocumentation

func GenerateDocumentation(root *cobra.Command, genPath, gitPath string) error

GenerateDocumentation generates hugo documentation for a command line

Types

type Doc

type Doc struct {
	Title         string
	Description   string
	Method        string
	URL           string
	QueryParams   []string
	ResponseBody  string
	RequestBody   string
	Middlewares   []Middleware
	Scopes        []string
	HTTPOperation string
}

Doc represents elements wanted in the documentation

type Method

type Method struct {
	Doc  string
	Name string
}

Method Represent data on a method

type Middleware

type Middleware struct {
	Name  string
	Value []string
}

Middleware represents a middleware

type RouteInfo

type RouteInfo struct {
	URL           string
	Method        string
	Middlewares   []Middleware
	Scopes        []string
	HTTPOperation string
}

RouteInfo Information on a route

Jump to

Keyboard shortcuts

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