cmd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Copyright © 2023 Mohamad Krayem <mohamadkrayem@email.com>

Index

Constants

This section is empty.

Variables

View Source
var Command = Cmd{}
View Source
var ConnectCmd = &cobra.Command{
	Use:   "connect",
	Short: "Send a connect request to a server.",
	Run: func(cmd *cobra.Command, args []string) {
		connect_command.Run(args, cmd)

	},
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		connect_command.Method = "CONNECT"
		connect_command.Body = Command.Body
		connect_command.Headers = Command.Headers
		connect_command.Form = &Command.Form
		connect_command.Sb = Command.ShowBody
		connect_command.Sh = Command.ShowHeaders
		connect_command.Ss = Command.ShowStatus
		connect_command.QueryParams = &Command.QueryParams
		connect_command.Https = Command.Https
		connect_command.BodyJS = &Command.BodyJS
		connect_command.HeadersJS = &Command.HeadersJS
		connect_command.Headersjs = &Command.Headersjs
		connect_command.Redirect = Command.Redirect
		connect_command.Cookies = &Command.Cookies
		connect_command.Multipart = Command.Multipart
		connect_command.BasicAuth = auth.NewBaseRequestFromMap(Command.Auth)
		connect_command.PersistentPreRun(cmd, args)
	},
	Args: cobra.MinimumNArgs(1),
}

ConnectCmd represents the get command

View Source
var GetCmd = &cobra.Command{
	Use:   "get",
	Short: "Send a GET request to a server.",
	Run: func(cmd *cobra.Command, args []string) {
		get_command.Run(args, cmd)

	},
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		get_command.Method = "GET"
		get_command.Body = Command.Body
		get_command.Headers = Command.Headers
		get_command.Form = &Command.Form
		get_command.Sb = Command.ShowBody
		get_command.Sh = Command.ShowHeaders
		get_command.Ss = Command.ShowStatus
		get_command.QueryParams = &Command.QueryParams
		get_command.Https = Command.Https
		get_command.BodyJS = &Command.BodyJS
		get_command.HeadersJS = &Command.HeadersJS
		get_command.Headersjs = &Command.Headersjs
		get_command.Redirect = Command.Redirect
		get_command.Cookies = &Command.Cookies
		get_command.Multipart = Command.Multipart
		get_command.BasicAuth = auth.NewBaseRequestFromMap(Command.Auth)
		get_command.PersistentPreRun(cmd, args)
	},
	Args: cobra.MinimumNArgs(1),
}

getCmd represents the get command

View Source
var TraceCmd = &cobra.Command{
	Use:   "trace",
	Short: "Send a TRACE request to a server.",
	Run: func(cmd *cobra.Command, args []string) {
		trace_command.Run(args, cmd)
	},
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		trace_command.Method = "CONNECT"
		trace_command.Body = Command.Body
		trace_command.Headers = Command.Headers
		trace_command.Form = &Command.Form
		trace_command.Sb = Command.ShowBody
		trace_command.Sh = Command.ShowHeaders
		trace_command.Ss = Command.ShowStatus
		trace_command.QueryParams = &Command.QueryParams
		trace_command.Https = Command.Https
		trace_command.BodyJS = &Command.BodyJS
		trace_command.HeadersJS = &Command.HeadersJS
		trace_command.Headersjs = &Command.Headersjs
		trace_command.Redirect = Command.Redirect
		trace_command.Cookies = &Command.Cookies
		trace_command.Multipart = Command.Multipart
		trace_command.BasicAuth = auth.NewBaseRequestFromMap(Command.Auth)
		trace_command.PersistentPreRun(cmd, args)
	},
	Args: cobra.MinimumNArgs(1),
}

TraceCmd represents the trace command

Functions

func Execute

func Execute()

Types

type Cmd

type Cmd struct {
	Method      string
	QueryParams map[string]string
	Cookies     map[string]string
	Auth        map[string]string
	Body        bool
	BodyJS      string
	Headers     bool
	HeadersJS   map[string]string
	Https       bool
	ShowStatus  bool
	ShowHeaders bool
	ShowBody    bool
	Form        bool
	Text        bool
	ReqHeaders  bool
	Headersjs   json.Json
	Redirect    bool
	Multipart   bool
}

Jump to

Keyboard shortcuts

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