models

package
v2.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aliases

type Aliases struct {
	Go         string `yaml:"go"`
	PowerShell string `yaml:"powershell"`
}

type BodyContent

type BodyContent struct {
	Type string `yaml:"type,omitempty"`
}

type BodyTemplate added in v2.30.0

type BodyTemplate struct {
	Type      string `yaml:"type"`
	ApplyLast bool   `yaml:"applyLast"`
	Template  string `yaml:"template"`
}

type Command added in v2.30.0

type Command struct {
	Name               string            `yaml:"name"`
	Description        string            `yaml:"description"`
	DescriptionLong    string            `yaml:"descriptionLong"`
	Preset             CommandPreset     `yaml:"preset"`
	Deprecated         string            `yaml:"deprecated"`
	DeprecatedAt       string            `yaml:"deprecatedAt"`
	Method             string            `yaml:"method"`
	SemanticMethod     string            `yaml:"semanticMethod"`
	Accept             string            `yaml:"accept,omitempty"`
	ContentType        string            `yaml:"contentType,omitempty"`
	CollectionType     string            `yaml:"collectionType,omitempty"`
	CollectionProperty string            `yaml:"collectionProperty,omitempty"`
	Path               string            `yaml:"path"`
	Examples           Examples          `yaml:"examples"`
	ExampleList        []Example         `yaml:"exampleList"`
	Alias              Aliases           `yaml:"alias"`
	Hidden             *bool             `yaml:"hidden,omitempty"`
	Skip               *bool             `yaml:"skip,omitempty"`
	QueryParameters    []Parameter       `yaml:"queryParameters,omitempty"`
	PathParameters     []Parameter       `yaml:"pathParameters,omitempty"`
	HeaderParameters   []Parameter       `yaml:"headerParameters,omitempty"`
	Body               []Parameter       `yaml:"body,omitempty"`
	BodyContent        *BodyContent      `yaml:"bodyContent,omitempty"`
	BodyTemplates      []BodyTemplate    `yaml:"bodyTemplates,omitempty"`
	BodyRequiredKeys   []string          `yaml:"bodyRequiredKeys,omitempty"`
	FlagMapping        map[string]string `yaml:"flagMapping"`
}

func (*Command) GetAllParameters added in v2.30.0

func (c *Command) GetAllParameters() []Parameter

func (*Command) GetBodyContentType added in v2.30.0

func (c *Command) GetBodyContentType() string

func (*Command) GetDescriptionLong added in v2.30.0

func (c *Command) GetDescriptionLong() string

func (*Command) GetExamples added in v2.30.0

func (c *Command) GetExamples() string

func (*Command) GetMethod added in v2.30.0

func (c *Command) GetMethod() string

func (*Command) GetQueryParameters added in v2.30.0

func (c *Command) GetQueryParameters() []Parameter

func (*Command) HasPreset added in v2.30.0

func (c *Command) HasPreset() bool

func (*Command) IsBodyFormData added in v2.30.0

func (c *Command) IsBodyFormData() bool

func (*Command) IsCollection added in v2.30.0

func (c *Command) IsCollection() bool

func (*Command) IsDeprecated added in v2.30.0

func (c *Command) IsDeprecated() bool

func (*Command) IsHidden added in v2.30.0

func (c *Command) IsHidden() bool

func (*Command) ShouldIgnore added in v2.30.0

func (c *Command) ShouldIgnore() bool

func (*Command) SupportsProcessingMode added in v2.30.0

func (c *Command) SupportsProcessingMode() bool

func (*Command) SupportsTemplates added in v2.30.0

func (c *Command) SupportsTemplates() bool

type CommandPreset added in v2.30.0

type CommandPreset struct {
	Type       string            `yaml:"type"`
	Options    map[string]string `yaml:"options,omitempty"`
	Extensions []Parameter       `yaml:"extensions,omitempty"`
}

func (*CommandPreset) GetOption added in v2.30.0

func (cp *CommandPreset) GetOption(k string, defaultValue ...string) string

type Completion added in v2.30.0

type Completion struct {
	Type    string   `yaml:"type,omitempty"`
	Command []string `yaml:"command,omitempty"`
}

type Configuration

type Configuration struct {
	Dir string            `yaml:"dir,omitempty"`
	Env map[string]string `yaml:"dir,env"`
}

type Example

type Example struct {
	Description  string           `yaml:"description,omitempty"`
	Command      string           `yaml:"command"`
	AssertStdout *OutputAssertion `yaml:"assertStdOut,omitempty"`
	AssertStderr *OutputAssertion `yaml:"assertStdErr,omitempty"`
	BeforeEach   []string         `yaml:"beforeEach,omitempty"`
	AfterEach    []string         `yaml:"afterEach,omitempty"`
	SkipTest     bool             `yaml:"skipTest,omitempty"`
}

type Examples

type Examples struct {
	Powershell []Example `yaml:"powershell"`
	Go         []Example `yaml:"go"`
}

type Group added in v2.30.0

type Group struct {
	Name            string `yaml:"name"`
	Description     string `yaml:"description"`
	DescriptionLong string `yaml:"descriptionLong"`
	Link            string `yaml:"link"`
	Skip            bool   `yaml:"skip"`
}

type MockConfiguration

type MockConfiguration struct {
	Mocks map[string]string `yaml:"mocks,omitempty"`
	Files map[string]string `yaml:"files,omitempty"`
}

func (*MockConfiguration) Replace

func (c *MockConfiguration) Replace(command string) string

func (*MockConfiguration) ReplaceFiles

func (c *MockConfiguration) ReplaceFiles(command string) string

type NamedLookup added in v2.30.0

type NamedLookup struct {
	Type    string             `yaml:"type,omitempty"`
	Command []string           `yaml:"command,omitempty"`
	Options NamedLookupOptions `yaml:"options"`
}

type NamedLookupOptions added in v2.30.0

type NamedLookupOptions struct {
	IDPattern string `yaml:"idPattern,omitempty"`
}

type OutputAssertion

type OutputAssertion struct {
	JSON     map[string]string `yaml:"json,omitempty"`
	Contains []string          `yaml:"contains,omitempty"`
}

type Parameter

type Parameter struct {
	Name            string      `yaml:"name,omitempty"`
	ShortName       string      `yaml:"shortname,omitempty"`
	Type            string      `yaml:"type,omitempty"`
	Value           string      `yaml:"value,omitempty"`
	Completion      Completion  `yaml:"completion,omitempty"`
	NamedLookup     NamedLookup `yaml:"lookup,omitempty"`
	Format          string      `yaml:"format,omitempty"`
	Property        string      `yaml:"property,omitempty"`
	Hidden          *bool       `yaml:"hidden,omitempty"`
	Pipeline        *bool       `yaml:"pipeline,omitempty"`
	PipelineAliases []string    `yaml:"pipelineAliases,omitempty"`
	Required        *bool       `yaml:"required,omitempty"`
	Description     string      `yaml:"description,omitempty"`
	Default         string      `yaml:"default,omitempty"`
	Position        *int        `yaml:"position,omitempty"`
	ValidationSet   []string    `yaml:"validationSet,omitempty"`
	Skip            *bool       `yaml:"skip,omitempty"`
	Children        []Parameter `yaml:"children,omitempty"`
	DependsOn       []string    `yaml:"dependsOn,omitempty"`

	TargetType TargetType `yaml:"-"`
}

func (*Parameter) AcceptsPipeline added in v2.30.0

func (p *Parameter) AcceptsPipeline() bool

func (*Parameter) GetDependentProperty added in v2.30.0

func (p *Parameter) GetDependentProperty(index int, defaultValue string) string

Get the first dependent property name defined for the current parameter. Return a default value if no dependent property is defined

func (*Parameter) GetDescription added in v2.30.0

func (p *Parameter) GetDescription() string

func (*Parameter) GetTargetProperty

func (p *Parameter) GetTargetProperty() string

func (*Parameter) IsHidden added in v2.30.0

func (p *Parameter) IsHidden() bool

func (*Parameter) IsRequired added in v2.30.0

func (p *Parameter) IsRequired() bool

func (*Parameter) IsTypeDateTime

func (p *Parameter) IsTypeDateTime() bool

type Specification

type Specification struct {
	Version  string    `yaml:"version"`
	Group    Group     `yaml:"group"`
	Commands []Command `yaml:"commands"`
}

type TargetType added in v2.30.0

type TargetType int
const (
	ParamHeader TargetType = iota
	ParamBody
	ParamPath
	ParamQueryParameter
)

type TestCase

type TestCase struct {
	Command       string           `yaml:"command,omitempty"`
	ExitCode      int              `yaml:"exit-code"`
	Skip          bool             `yaml:"skip,omitempty"`
	LineCount     int              `yaml:"line-count,omitempty"`
	StdOut        *OutputAssertion `yaml:"stdout,omitempty"`
	StdErr        *OutputAssertion `yaml:"stderr,omitempty"`
	Configuration *Configuration   `yaml:"config,omitempty"`
}

type TestSuite

type TestSuite struct {
	Configuration *Configuration      `yaml:"config,omitempty"`
	Tests         map[string]TestCase `yaml:"tests"`
}

Jump to

Keyboard shortcuts

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