lib

package
v0.0.0-...-62d41e2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLI struct {
	Yaml struct {
		Src   string `arg help:"Source Dir"`
		Fname string `arg help:"File to be generated"`
	} `cmd help:"Gens YAML metamodel"`
	Goserver struct {
		Src string `arg help:"Source Dir"`
	} `cmd help:"Gens GO Server impl"`
	//Gin struct {
	//	Src string `arg help:"Source Dir"`
	//} `cmd help:"Gens Gin Server impl"`
	Gocli struct {
		Src string `arg help:"Source Dir"`
		Dst string `arg help:"Dst file"`
	} `cmd help:"Gens Go Cli impl"`
	Pycli struct {
		Src string `arg help:"Source Dir"`
		Dst string `arg help:"Dst file"`
	} `cmd help:"Gens Python Cli impl"`
	Ts struct {
		Src string `arg help:"Source Dir"`
		Dst string `arg help:"Dst file"`
	} `cmd help:"Gens Typescript Cli impl"`
	Http struct {
		Src string `arg help:"Source Dir"`
		Dst string `arg help:"Dst file"`
	} `cmd help:"Gens Http call impl"`
}

Functions

func APIParamTypeDecToString

func APIParamTypeDecToString(t *APIParamType) string

func APIParamTypeToString

func APIParamTypeToString(t *APIParamType) string

func APIParamTypeUseRef

func APIParamTypeUseRef(t *APIParamType) string

func Debug

func Debug(s string, p ...interface{})

func Err

func Err(e error)

func Log

func Log(s string, p ...interface{})

func Run

func Run()

Types

type API

type API struct {
	BasePath             string                `yaml:"basepath,omitempty"`
	Host                 string                `yaml:"host,omitempty"`
	Types                map[string]*APIType   `yaml:"types,omitempty"`
	Methods              map[string]*APIMethod `yaml:"methods,omitempty"`
	Namespace            string                `yaml:"namespace"`
	Imports              map[string]string     `yaml:"imports"`
	UsedImportsTypes     map[string]string     `yaml:"used_imports_types"`
	UsedImportsFunctions map[string]string     `yaml:"used_imports_functions"`
	SortedPaths          []*APIPath            `yaml:"-"`
	Paths                map[string]*APIPath   `yaml:"paths"`
}

type APIField

type APIField struct {
	Type   string                 `yaml:"type,omitempty"`
	Array  bool                   `yaml:"array,omitempty"`
	Desc   string                 `yaml:"desc,omitempty"`
	Map    bool                   `yaml:"map,omitempty"`
	Mapkey string                 `yaml:"mapkey,omitempty"`
	Mapval string                 `yaml:"mapval,omitempty"`
	Tags   map[string]APIFieldTag `yaml:"tags,omitempty"`
}

func (*APIField) String

func (a *APIField) String() string

type APIFieldTag

type APIFieldTag struct {
	Key  string   `yaml:"key"`
	Name string   `yaml:"name"`
	Opts []string `yaml:"opts"`
}

type APIMethod

type APIMethod struct {
	Name    string `yaml:"name"`
	Desc    string `yaml:"desc"`
	Verb    string `yaml:"verb"`
	Path    string `yaml:"path"`
	Perm    string `yaml:"perm"`
	Raw     bool   `yaml:"raw"`
	OpID    string `yaml:"op_id"`
	ReqType *APIParamType
	ResType *APIParamType
}

type APIParamType

type APIParamType struct {
	Typename  string
	Ispointer bool
	IsArray   bool
}

type APIPath

type APIPath struct {
	Path        string              `yaml:"path"`
	MapVerbs    map[string]*APIVerb `yaml:"map_verbs"`
	SortedVerbs []*APIVerb          `yaml:"sorted_verbs"`
}

type APIType

type APIType struct {
	Name    string               `yaml:"name,omitempty"`
	Desc    string               `yaml:"desc,omitempty"`
	Fields  map[string]*APIField `yaml:"fields,omitempty"`
	Col     string               `yaml:"col,omitempty"`
	TypeDef string               `yaml:"-"`
}

type APIVerb

type APIVerb struct {
	Verb   string     `yaml:"verb"`
	Method *APIMethod `yaml:"method"`
}

Jump to

Keyboard shortcuts

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