test

package
v1.0.106 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Config           string
	ConfigFile       string
	StdIn            *bytes.Buffer
	Definitions      []commandline.DefinitionData
	NextResponses    []ResponseData
	Responses        map[string]ResponseData
	IdentityResponse ResponseData
	CommandPlugin    plugin.CommandPlugin
}

type ContextBuilder

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

func NewContextBuilder

func NewContextBuilder() *ContextBuilder

func (*ContextBuilder) Build

func (b *ContextBuilder) Build() Context

func (*ContextBuilder) WithCommandPlugin

func (b *ContextBuilder) WithCommandPlugin(commandPlugin plugin.CommandPlugin) *ContextBuilder

func (*ContextBuilder) WithConfig

func (b *ContextBuilder) WithConfig(config string) *ContextBuilder

func (*ContextBuilder) WithConfigFile

func (b *ContextBuilder) WithConfigFile(configFile string) *ContextBuilder

func (*ContextBuilder) WithDefinition

func (b *ContextBuilder) WithDefinition(name string, data string) *ContextBuilder

func (*ContextBuilder) WithDefinitionVersion

func (b *ContextBuilder) WithDefinitionVersion(name string, version string, data string) *ContextBuilder

func (*ContextBuilder) WithIdentityResponse

func (b *ContextBuilder) WithIdentityResponse(statusCode int, body string) *ContextBuilder

func (*ContextBuilder) WithNextResponse

func (b *ContextBuilder) WithNextResponse(statusCode int, body string) *ContextBuilder

func (*ContextBuilder) WithResponse

func (b *ContextBuilder) WithResponse(statusCode int, body string) *ContextBuilder

func (*ContextBuilder) WithStdIn

func (b *ContextBuilder) WithStdIn(input bytes.Buffer) *ContextBuilder

func (*ContextBuilder) WithUrlResponse

func (b *ContextBuilder) WithUrlResponse(url string, statusCode int, body string) *ContextBuilder

type ResponseData

type ResponseData struct {
	Status int
	Body   string
}

type Result

type Result struct {
	Error         error
	StdOut        string
	StdErr        string
	RequestUrl    string
	RequestHeader map[string]string
	RequestBody   string
}

func RunCli

func RunCli(args []string, context Context) Result

Jump to

Keyboard shortcuts

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