command

package
v0.0.0-...-deb869b Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIR  = iota
	FILE = iota
)

Variables

View Source
var Build = cli.Command{
	Name:    "build",
	Aliases: []string{"b"},
	Usage:   "Builds the static site ready for production deployment.",
	Action: func(c *cli.Context) {
		println("Building Documentation Site...")
		buildc()
		println("Done!")
	},
}
View Source
var Init = cli.Command{
	Name:    "init",
	Aliases: []string{"i"},
	Usage:   "Create a new api doc site from the command line.",
	Action: func(c *cli.Context) {
		println("Creating new site.....", c.Args()[0])
		initc(c.Args()[0], c.Args()[1])
	},
}
View Source
var Pump = cli.Command{
	Name:    "pump",
	Aliases: []string{"p"},
	Usage:   "Serve site locally and watch for API changes.",
	Action: func(c *cli.Context) {
		println("starting server...")
	},
}
View Source
var Serve = cli.Command{
	Name:    "serve",
	Aliases: []string{"s"},
	Usage:   "Serve your site locally.",
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "o,host",
			Usage: "Input address for serving the site",
			Value: "0.0.0.0",
		},
		cli.StringFlag{
			Name:  "p,port",
			Usage: "Input port for serving the site",
			Value: "8080",
		},
	},
	Action: func(c *cli.Context) {
		fmt.Println("Starting Server...")
		Servec(c.String("port"), c.String("host"))
	},
}

Functions

func BuildTemplate

func BuildTemplate(outFile string)

func CopyDir

func CopyDir(source string, dest string) (err error)

Recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist.

func CopyFile

func CopyFile(source string, dest string) (err error)

Copies file source to destination dest.

func Servec

func Servec(port string, host string)

func WriteCSSAsset

func WriteCSSAsset(outFile string, assetName string)

func WriteHtmlTemplate

func WriteHtmlTemplate(outFile string) error

func WriteJSAsset

func WriteJSAsset(outFile string, assetName string)

func WriteJSAssetAll

func WriteJSAssetAll(outFile string)

func WriteMdSection

func WriteMdSection(outFile string, sectionData interface{}, sectionName string) error

Types

type AssetInfo

type AssetInfo struct {
	Path string
	Type int
}

type AuthenticationMd

type AuthenticationMd struct {
	Summary string
	C       string
	Cpp     string
	Erlang  string
	Go      string
	Note    string
}

type EntityMd

type EntityMd struct {
	Entity      string
	Description string
}

type HeaderJson

type HeaderJson struct {
	Swagger string
	Info    struct {
		Version   string
		Title     string
		Languages []string
	}
}

type IntroMd

type IntroMd struct {
	Content string
}

Section data structs ...

type Json

type Json struct {
	Info struct {
		Description    string
		Authentication struct {
			Summary  string
			Snippets struct {
				C      string
				Cpp    string
				Erlang string
				Go     string
			}
			Note string
		}
		Termsofservice string
		Contact        struct {
			Name string
			URL  string
		}
		License struct {
			Name string
			URL  string
		}
	}
	Paths struct {
		Charges struct {
			Get struct {
				Summary string `json:"summary"`
			} `json:"get"`
		} `json:"/charges"`
		Refunds struct {
			Get struct {
				Summary string `json:"summary"`
			} `json:"get"`
		} `json:"/refunds"`
	} `json:"paths"`
}

Jump to

Keyboard shortcuts

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