apidoc

package
v0.0.0-...-c1a347c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	APIROUTERS      map[string]*Api       // apiName:api
	APIROUTERGROUPS map[string]string     // groupName:package -> user:gop/api/user
	APIMODELS       map[string][]*ApiItem // apiReq:apiItems
	APIIMPORTS      map[string][]string   // groupName:imports
	DECLS           map[string]*ApiItem   // package.file.func.name:type

	COMMENTS map[string]string // fieLinePos:comment

	APIPREIFX     string
	APIROUTERPATH string
	APIMODELPATH  string
)

Functions

func ConvertType

func ConvertType(goType string) (apiDocType string)

func GenApiDoc

func GenApiDoc(home, saveDir, name, title, desc, version, url string)

func IsFileNotExist

func IsFileNotExist(path string) bool

func SplitOnce

func SplitOnce(s, sep string) []string

Types

type Api

type Api struct {
	Name      string
	Method    string
	Path      string
	Comment   string
	Group     string
	NeedAuth  bool
	Params    []*ApiItem
	Success   []*ApiItem
	GOPackage string
}

func (*Api) Doc

func (x *Api) Doc() string

type ApiDoc

type ApiDoc struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"descrption"`
	Title       string `json:"title"`
	URL         string `json:"url"`
	Apis        []*Api `json:"api"`
}

func (*ApiDoc) Doc

func (x *ApiDoc) Doc() string

type ApiItem

type ApiItem struct {
	Name       string
	OriginName string
	Type       string
	Required   bool
	IsArray    bool
	Comment    string
	GOPackage  string
	ChildItem  []*ApiItem // Object
}

func (*ApiItem) Doc

func (x *ApiItem) Doc(parent string) []string

Jump to

Keyboard shortcuts

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