fortio: fortio.org/fortio/bincommon Index | Files

package bincommon

import "fortio.org/fortio/bincommon"

Package bincommon is the common code and flag handling between the fortio (fortio_main.go) and fcurl (fcurl.go) executables.

Index

Package Files

commonflags.go

Variables

var (

    // QuietFlag is the value of -quiet.
    QuietFlag = flag.Bool("quiet", false, "Quiet mode: sets the loglevel to Error and reduces the output.")

    // PayloadSizeFlag is the value of -payload-size
    PayloadSizeFlag = flag.Int("payload-size", 0, "Additional random payload size, replaces -payload when set > 0,"+
        " must be smaller than -maxpayloadsizekb. Setting this switches http to POST.")
    // PayloadFlag is the value of -payload
    PayloadFlag = flag.String("payload", "", "Payload string to send along")
    // PayloadFileFlag is the value of -paylaod-file
    PayloadFileFlag = flag.String("payload-file", "", "File `path` to be use as payload (POST for http), replaces -payload when set.")
)

func FetchURL Uses

func FetchURL(o *fhttp.HTTPOptions)

FetchURL is fetching url content and exiting with 1 upon error. common part between fortio_main and fcurl.

func FlagsUsage Uses

func FlagsUsage(w io.Writer, msgs ...interface{})

FlagsUsage prints end of the usage() (flags part + error message).

func SharedHTTPOptions Uses

func SharedHTTPOptions() *fhttp.HTTPOptions

SharedHTTPOptions is the flag->httpoptions transfer code shared between fortio_main and fcurl.

func SharedMain Uses

func SharedMain(usage func(io.Writer, ...interface{}))

SharedMain is the common part of main from fortio_main and fcurl.

Package bincommon imports 10 packages (graph) and is imported by 6 packages. Updated 2019-05-26. Refresh now. Tools for package owners.