types

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonReturn added in v0.0.3

type CommonReturn struct {

	// For those modules that implement backup=no|yes when manipulating files, a path to the backup file created.
	BackupFile string `yaml:"backup_file,omitempty" json:"backup_file,omitempty"`

	// A boolean indicating if the task had to make changes.
	Changed bool `yaml:"changed,omitempty" json:"changed,omitempty"`

	// A boolean that indicates if the task was failed or not.
	Failed bool `yaml:"failed,omitempty" json:"failed,omitempty"`

	// A string with a generic message relayed to the user.
	Msg string `yaml:"msg,omitempty" json:"msg,omitempty"`

	// Some modules execute command line utilities or are geared for executing commands directly (raw, shell, command, etc), this field contains ‘return code’ of these utilities.
	Rc int `yaml:"rc,omitempty" json:"rc,omitempty"`

	// A boolean that indicates if the task was skipped or not
	Skipped bool `yaml:"skipped,omitempty" json:"skipped,omitempty"`

	// Some modules execute command line utilities or are geared for executing commands directly (raw, shell, command, etc), this field contains the error output of these utilities.
	Stderr string `yaml:"stderr,omitempty" json:"stderr,omitempty"`

	// Some modules execute command line utilities or are geared for executing commands directly (raw, shell, command, etc). This field contains the normal output of these utilities.
	Stdout string `yaml:"stdout,omitempty" json:"stdout,omitempty"`
}

type CtyValue added in v0.0.10

type CtyValue interface {
	Type() cty.Type
}

type Module

type Module interface {
	GetResultRaw() string
	GetCommonResult() CommonReturn
	GetParams() Params
	GetResult() Result
	GetType() string
}

type ModuleSpec added in v0.0.6

type ModuleSpec 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           ParamSpecs  `yaml:"options" json:"options"`
	Returns          ReturnSpecs `yaml:"returns" json:"returns"`
	Path             string      `yaml:"-" json:"-"`
	Documentation    string      `yaml:"doc" json:"doc"`
	Return           string      `yaml:"return" json:"return"`
	SourceLink       string      `yaml:"-" json:"-"`
}

type ParamSpec added in v0.0.6

type ParamSpec 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 ParamSpecs added in v0.0.6

type ParamSpecs map[string]*ParamSpec

func (*ParamSpecs) Defaults added in v0.0.6

func (p *ParamSpecs) Defaults() map[string]interface{}

func (*ParamSpecs) Names added in v0.0.6

func (p *ParamSpecs) Names() []string

type Params added in v0.0.6

type Params interface {
	Names() []string
	Set(name string, value interface{}) error
	Get(name string) (interface{}, error)
}

type Result added in v0.0.6

type Result interface {
	Names() []string
	Set(name string, value interface{}) error
	Get(name string) (interface{}, error)
}

type ReturnSpec added in v0.0.6

type ReturnSpec 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"`
}

func (*ReturnSpec) Desc added in v0.0.6

func (r *ReturnSpec) Desc() []string

Desc special handling since description can be either a string or a string slice.

type ReturnSpecs added in v0.0.6

type ReturnSpecs map[string]*ReturnSpec

func (*ReturnSpecs) Names added in v0.0.6

func (p *ReturnSpecs) Names() []string

type Spec

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

func Parse

func Parse(raw []byte) (*Spec, error)

type Value added in v0.0.6

type Value interface {
	Set(value interface{}) error
	Get() interface{}
}

func NewBoolValue added in v0.0.6

func NewBoolValue(v *bool) Value

func NewFloat64Value added in v0.0.7

func NewFloat64Value(v *float64) Value

func NewIntListValue added in v0.0.9

func NewIntListValue(v *[]int) Value

func NewIntValue added in v0.0.6

func NewIntValue(v *int) Value

func NewStringListValue added in v0.0.9

func NewStringListValue(v *[]string) Value

func NewStringMapValue added in v0.0.7

func NewStringMapValue(v *map[string]string) Value

func NewStringValue added in v0.0.6

func NewStringValue(v *string) Value

Jump to

Keyboard shortcuts

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