parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	NormalizedName   string             `yaml:"normalizedName" json:"normalizedName"`
	ModuleName       string             `yaml:"module" json:"module"`
	ShortDescription string             `yaml:"short_description" json:"short_description"`
	Description      []string           `yaml:"description" json:"description"`
	Params           map[string]*Param  `yaml:"options" json:"options"`
	Returns          map[string]*Return `yaml:"returns" json:"returns"`
	Path             string             `yaml:"-" json:"-"`
	Documentation    string             `yaml:"doc" json:"doc"`
	Return           string             `yaml:"return" json:"return"`
}

type Param

type Param struct {
	NormalizedName string      `yaml:"normalizedName" json:"normalizedName"`
	StructTag      string      `yaml:"structTag" json:"structTag"`
	GoType         string      `yaml:"goType" json:"goType"`
	GoElements     string      `yaml:"goElements" json:"goElements"`
	Description    []string    `yaml:"description" json:"description"`
	Type           string      `default:"str" yaml:"type" json:"type"`
	Required       bool        `default:"no" yaml:"required" json:"required"`
	Default        interface{} `yaml:"default" json:"default"`
	Elements       string      `yaml:"elements" json:"elements"`
	Aliases        []string    `yaml:"aliases" json:"aliases"`
}

type Return

type Return struct {
	NormalizedName string      `yaml:"normalizedName" json:"normalizedName"`
	Description    interface{} `yaml:"description" json:"description"`
	Returned       string      `yaml:"returned" json:"returned"`
	// complex type is not supported...
	Type   string      `default:"str" yaml:"type" json:"type"`
	Sample interface{} `yaml:"sample" json:"sample"`

	GoType    string `yaml:"goType" json:"goType"`
	StructTag string `yaml:"structTag" json:"structTag"`
}

type Spec

type Spec struct {
	Modules []Module `yaml:"modules" json:"modules"`
}

func ParseModules

func ParseModules(dir string) (*Spec, error)

ParseModules parses modules from Ansible source

func ParseModulesFromSpec

func ParseModulesFromSpec(raw string) (*Spec, error)

Jump to

Keyboard shortcuts

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