pgg

command module
v0.0.0-...-9a7907c Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

README

pgg

Post from the Get-Go

Synopsis

pgg [-m GET] [-e foo] [-c config-file] [-f "param_name=./foo.txt"] "http://example.com/{{my_var}}"

Description

Pgg - Post from the Get-Go. Pgg is a client you can use to send http requests while taking advantage of custom environments set in a configuration file.

Options

-m, -method Specify the request method.

-e, -env Specify the environment to use.

-c, -cfg Specify an alternative config file.

-f, -file Specify the file to upload.

-h Prints the help message.

--help Prints options details.

Files

When starting pgg looks for configuration files in the following order:

You can specify a custom path using the -c option. 1. ~/.config/pgg/config 2. ~/.pgg/config

The config file must be written in TOML style. The variables defined in the environments can be accessed by enclosing their name in double curly brackets.

For example running: pgg -e foo 'http://example.com/{{foo}}/{{name}}'

will result in a GET request to http://example.com/bar/pgg.

Sample configuration

# pgg config file

# Set the default environment.
default_env = "foo"
[env]
   # Add a custom environment named "foo".
   [env.foo]
   scheme = "http://"
   vars = [
       "foo=bar",
       "name=pgg"
   ]

   # Add a custom environment named "bar".
   [env.bar]
   scheme = "ftp://"
   vars = [
       "base_url=www.example.com"
   ]

Environment

$HOME This variable is used to read the config file $HOME/.config/pgg/config

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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