input

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	BodyType      BodyType
	Fields        []Field
	RawJSONFields []Field // used only when BodyType == JSONBody
	Files         []Field // used only when BodyType == FormBody
	Raw           []byte  // used only when BodyType == RawBody
}

type BodyType

type BodyType int
const (
	EmptyBody BodyType = iota
	JSONBody
	FormBody
	RawBody
)

type Field

type Field struct {
	Name   string
	Value  string
	IsFile bool
}
type Header struct {
	Fields []Field
}

type Input

type Input struct {
	Method     Method
	URL        *url.URL
	Parameters []Field
	Header     Header
	Body       Body
}

func ParseArgs

func ParseArgs(args []string, stdin io.Reader, options *Options) (*Input, error)

type Method

type Method string

type Options

type Options struct {
	JSON      bool
	Form      bool
	ReadStdin bool
}

type UsageError

type UsageError string

func (*UsageError) Error

func (e *UsageError) Error() string

Jump to

Keyboard shortcuts

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