config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContentTypes = map[string]string{
	"json":      "application/json",
	"form":      "application/x-www-form-urlencoded",
	"multipart": "multipart/form-data",
}
View Source
var DefaultConfig = Config{
	General: GeneralOptions{
		DefaultURLScheme:       "https",
		Editor:                 "vim",
		FollowRedirects:        true,
		FormatJSON:             true,
		Insecure:               false,
		PreserveScrollPosition: true,
		StatusLine:             "[wuzz {{.Version}}]{{if .Duration}} [Response time: {{.Duration}}]{{end}} [Request no.: {{.RequestNumber}}/{{.HistorySize}}] [Search type: {{.SearchType}}]",
		Timeout: Duration{
			defaultTimeoutDuration,
		},
	},
}
View Source
var DefaultKeys = map[string]map[string]string{
	"global": {
		"CtrlR": "submit",
		"CtrlC": "quit",
		"CtrlS": "saveResponse",
		"CtrlF": "loadRequest",
		"CtrlE": "saveRequest",
		"CtrlD": "deleteLine",
		"CtrlW": "deleteWord",
		"CtrlO": "openEditor",
		"CtrlT": "toggleContextSpecificSearch",
		"CtrlX": "clearHistory",
		"Tab":   "nextView",
		"CtrlJ": "nextView",
		"CtrlK": "prevView",
		"AltH":  "history",
		"F2":    "focus url",
		"F3":    "focus get",
		"F4":    "focus method",
		"F5":    "focus data",
		"F6":    "focus headers",
		"F7":    "focus search",
		"F8":    "focus response-headers",
		"F9":    "focus response-body",
	},
	"url": {
		"Enter": "submit",
	},
	"response-headers": {
		"ArrowUp":   "scrollUp",
		"ArrowDown": "scrollDown",
		"PageUp":    "pageUp",
		"PageDown":  "pageDown",
	},
	"response-body": {
		"ArrowUp":   "scrollUp",
		"ArrowDown": "scrollDown",
		"PageUp":    "pageUp",
		"PageDown":  "pageDown",
	},
	"help": {
		"ArrowUp":   "scrollUp",
		"ArrowDown": "scrollDown",
		"PageUp":    "pageUp",
		"PageDown":  "pageDown",
	},
}

Functions

func GetDefaultConfigLocation

func GetDefaultConfigLocation() string

Types

type Config

type Config struct {
	General GeneralOptions
	Keys    map[string]map[string]string
}

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

type Duration

type Duration struct {
	time.Duration
}

Duration is used to automatically unmarshal timeout strings to time.Duration values

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type GeneralOptions

type GeneralOptions struct {
	ContextSpecificSearch  bool
	DefaultURLScheme       string
	Editor                 string
	FollowRedirects        bool
	FormatJSON             bool
	Insecure               bool
	PreserveScrollPosition bool
	StatusLine             string
	TLSVersionMax          uint16
	TLSVersionMin          uint16
	Timeout                Duration
}

Jump to

Keyboard shortcuts

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