gorestdoc

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go REST Docs

Documentation generation tool for RESTful services. Concept based on Spring REST Docs which incorporates handwritten documentation along with snippets generated from tests. This approach frees you from using heavy frameworks like Swagger.

In this way your documentation should be kept up to date with your integration tests. It should also be deployable as a static file and not waste system resources serving API documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIDoc

type APIDoc struct {
	Title       string
	Description string
	Generated   time.Time
	// contains filtered or unexported fields
}

APIDoc Builds a base document for testing

func NewAPIDoc

func NewAPIDoc(title, description string) *APIDoc

func (*APIDoc) AddDomain

func (doc *APIDoc) AddDomain(name, description string)

AddDomain allows you to define a domain and description

func (*APIDoc) AddHTTPRequest

func (doc *APIDoc) AddHTTPRequest(domain, description string, req *http.Request) (*http.Response, error)

AddHTTPRequest

func (*APIDoc) GenerateMarkdownFile

func (doc *APIDoc) GenerateMarkdownFile()

GenerateHTMLFile creates an Markdown file from document struct

func (*APIDoc) Print

func (doc *APIDoc) Print() string

Print outputs a string response

func (*APIDoc) SetHTMLFileName

func (doc *APIDoc) SetHTMLFileName(name string)

SetHTMLFileName overrides default output name to given name

func (*APIDoc) SetMarkdownFileName

func (doc *APIDoc) SetMarkdownFileName(name string)

SetMarkdownFileName overrides default output name to given name

type MarkDownBuilder

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

func (*MarkDownBuilder) Body

func (b *MarkDownBuilder) Body(body string) *MarkDownBuilder

func (*MarkDownBuilder) Build

func (b *MarkDownBuilder) Build() string

func (*MarkDownBuilder) Code

func (b *MarkDownBuilder) Code(code string) *MarkDownBuilder

func (*MarkDownBuilder) H1

func (b *MarkDownBuilder) H1(title string) *MarkDownBuilder

func (*MarkDownBuilder) H2

func (b *MarkDownBuilder) H2(title string) *MarkDownBuilder

func (*MarkDownBuilder) H3

func (b *MarkDownBuilder) H3(title string) *MarkDownBuilder

func (*MarkDownBuilder) H4

func (b *MarkDownBuilder) H4(title string) *MarkDownBuilder

Jump to

Keyboard shortcuts

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