config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 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",
}
View Source
var DefaultConfig = Config{
	General: GeneralOptions{
		Timeout: Duration{
			defaultTimeoutDuration,
		},
		FormatJSON:             true,
		Insecure:               false,
		PreserveScrollPosition: true,
		FollowRedirects:        true,
		StatusLine:             "[wuzz {{.Version}}]{{if .Duration}} [Response time: {{.Duration}}]{{end}}",
		DefaultURLScheme:       "https",
	},
}
View Source
var DefaultKeys = map[string]map[string]string{
	"global": map[string]string{
		"CtrlR": "submit",
		"CtrlC": "quit",
		"CtrlS": "save",
		"CtrlD": "deleteLine",
		"CtrlW": "deleteWord",
		"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": map[string]string{
		"Enter": "submit",
	},
	"response-headers": map[string]string{
		"ArrowUp":   "scrollUp",
		"ArrowDown": "scrollDown",
		"PageUp":    "pageUp",
		"PageDown":  "pageDown",
	},
	"response-body": map[string]string{
		"ArrowUp":   "scrollUp",
		"ArrowDown": "scrollDown",
		"PageUp":    "pageUp",
		"PageDown":  "pageDown",
	},
	"help": map[string]string{
		"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 {
	Timeout                Duration
	FormatJSON             bool
	Insecure               bool
	PreserveScrollPosition bool
	FollowRedirects        bool
	DefaultURLScheme       string
	StatusLine             string
	TLSVersionMin          uint16
	TLSVersionMax          uint16
}

Jump to

Keyboard shortcuts

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