generator

package module
v0.0.0-...-cd90a17 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const InputFile = "InputFile"

Variables

This section is empty.

Functions

This section is empty.

Types

type APISchema

type APISchema struct {
	Articles map[string]Article `json:"articles"`
	Methods  map[string]Method  `json:"methods"`
	Types    map[string]Type    `json:"types"`
	Version  string             `json:"version"`

	BuildInfo  map[string]interface{} `json:"build_info"`
	Changelogs map[string]interface{} `json:"changelogs"`
}

type Article

type Article struct {
	Description
	Title    string `json:"title"`
	Category string `json:"category"`
}

type Description

type Description struct {
	PlainText string `json:"plaintext"`
	Markdown  string `json:"markdown"`
	HTML      string `json:"html"`
}

type Field

type Field struct {
	Types       []TypeMapping `json:"types"`
	Description Description   `json:"description"`
	Required    bool          `json:"required"`
}

type Generator

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

func NewGenerator

func NewGenerator(schemaFile, tempaltesDir string) (*Generator, error)

func (*Generator) Generate

func (g *Generator) Generate(outDir string) error

type Method

type Method struct {
	Arguments map[string]Field `json:"arguments"`
	// null available
	Returns     *TypeMapping `json:"returns"`
	Description Description  `json:"description"`
	Category    string       `json:"category"`
}

type Type

type Type struct {
	Fields      map[string]Field `json:"fields"`
	Description Description      `json:"description"`
	Category    string           `json:"category"`
}

type TypeMapping

type TypeMapping string

func (TypeMapping) ArrayType

func (t TypeMapping) ArrayType() TypeMapping

func (TypeMapping) GoType

func (t TypeMapping) GoType() string

func (TypeMapping) IsArray

func (t TypeMapping) IsArray() bool

func (TypeMapping) IsSimpleType

func (t TypeMapping) IsSimpleType() bool

func (TypeMapping) SplitArray

func (t TypeMapping) SplitArray() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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