internal

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Verbose conditions the quantity of output of api requests
	Verbose bool

	// ConfigFile is $HOME/.tatcli/config.json per default
	// contains user, password and url of tat
	ConfigFile string

	// SSLInsecureSkipVerify Skip certificate check with SSL connection
	SSLInsecureSkipVerify bool

	// Pretty prints json return in pretty format
	Pretty bool

	// URL of tat engine
	URL string

	// Username of tat user
	Username string

	// Password of tat user
	Password string
)

Functions

func Check

func Check(e error)

Check checks error, if != nil, throw panic

func DeleteWant

func DeleteWant(path string, jsonStr []byte)

DeleteWant DELETE on path and check is http return code is 200

func GetSkipLimit

func GetSkipLimit(args []string) (string, string)

GetSkipLimit gets skip and limit in args array default skip to 0 and limit to 10

func GetTLSConfig

func GetTLSConfig() *tls.Config

GetTLSConfig returns tls.config with flag InsecureSkipVerify

func GetWantReturn

func GetWantReturn(path string) string

GetWantReturn GET on path and check is http return code is 200 and returns results

func IsHTTPS

func IsHTTPS() bool

IsHTTPS returns true if url begins with https

func PostWant

func PostWant(path string, jsonStr []byte) string

PostWant POST on path and check is http return code is 201

func PutWant

func PutWant(path string, jsonStr []byte)

PutWant PUT on path and check is http return code is 200

func PutWantReturn

func PutWantReturn(path string) string

PutWantReturn PUT on path, check is http return code is 200 and returns results

func ReadConfig

func ReadConfig()

ReadConfig reads config in .tatcli/config per default

func ReqWant

func ReqWant(method string, wantCode int, path string, jsonStr []byte) string

ReqWant execute a request of method (POST, PUT, DELETE) on path, checks if return HTTP Code is equals to wantCode

Types

This section is empty.

Jump to

Keyboard shortcuts

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