docgenerator

package
v0.0.0-...-25a8327 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContributorsFilePath = "CONTRIBUTORS"

ContributorsFilePath identifies the contributors path in root dir.

View Source
var ErrNothingChanged = fmt.Errorf("nothing to commit")

ErrNothingChanged is used when git commit has nothing to commit.

Functions

func GenContributorsList

func GenContributorsList() (string, error)

GenContributorsList generates the contributors list via git command.

func GetContributorsFileHeader

func GetContributorsFileHeader() string

GetContributorsFileHeader will return a common header for file CONTRIBUTOR, and show how to get this file.

Types

type Generator

type Generator struct {

	// RootDir specifies repo's rootdir which is to generated docs.
	RootDir string

	// SwaggerPath specifies that which dir is the swagger.yml file in root dir.
	// this is a relative path to root dir.
	SwaggerPath string

	// APIDocPath specifies where to generate the swagger tool.
	// this is a relative path to root dir.
	APIDocPath string

	// GenerationHour represents doc generation time every day.
	GenerationHour int

	// CliDocGeneratorCmd represents the command users input to generate cli
	// related document.
	CliDocGeneratorCmd string
	// contains filtered or unexported fields
}

Generator is a processor that periodically auto generated cli and api docs for github repo.

func New

func New(client *gh.Client,
	owner, repo string,
	rootdir, swaggerPath, apiDocPath string,
	generationHour int,
	cliDocGeneratorCmd string) (*Generator, error)

New initializes a brand new doc generator

func (*Generator) Run

func (g *Generator) Run() error

Run starts periodical work of doc generator. currently generator generates doc every day.

Jump to

Keyboard shortcuts

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