shared

package
v0.0.0-...-ad9e631 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingURL = errors.New("Missing required url paramater")

ErrMissingURL is returned when a URL is not passed to the command

View Source
var ErrUnknownArg = errors.New("Unknown non-flag argument(s) present after command")

ErrUnknownArg is returned when non-flag arguments are present after the command

Functions

func HTTPCode

func HTTPCode(url string, timeout time.Duration, insecure bool) (int, error)

HTTPCode returns the http code of requested url

Types

type Config

type Config struct {
	URL      *url.URL
	Code     int
	Timeout  time.Duration
	Insecure bool
	// contains filtered or unexported fields
}

Config represents shared config

func (*Config) Flags

func (c *Config) Flags(cmdFlags *flag.FlagSet)

Flags adds flags to populate shared config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates shared config

Jump to

Keyboard shortcuts

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