requesters

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResponseBody

func GetResponseBody(url string, postP PostParams) ([]byte, error)

GetResponseBody makes request and extracts body

func GetSeed

func GetSeed(url string) ([]byte, error)

GetSeed makes get_seed request and extracts it

func Send

func Send(ctx context.Context, url string, userCfg *UserConfigJSON, reqCfg *RequestConfigJSON) ([]byte, error)

Send first gets seed and after that makes target request

func SendWithSeed

func SendWithSeed(ctx context.Context, url string, userCfg *UserConfigJSON, reqCfg *RequestConfigJSON, seed []byte) ([]byte, error)

SendWithSeed sends request with known seed

func SetVerbose

func SetVerbose(verb bool)

SetVerbose switches on verbose mode

Types

type PostParams

type PostParams = map[string]interface{}

PostParams represents params struct

type RequestConfigJSON

type RequestConfigJSON struct {
	Params []interface{} `json:"params"`
	Method string        `json:"method"`
}

RequestConfigJSON holds info about request

func ReadRequestConfigFromFile

func ReadRequestConfigFromFile(path string) (*RequestConfigJSON, error)

ReadRequestConfigFromFile read request config from file

type UserConfigJSON

type UserConfigJSON struct {
	PrivateKey string `json:"private_key"`
	Caller     string `json:"caller"`
	// contains filtered or unexported fields
}

UserConfigJSON holds info about user

func CreateUserConfig added in v0.6.1

func CreateUserConfig(caller string, privKey string) (*UserConfigJSON, error)

CreateUserConfig creates user config from arguments

func ReadUserConfigFromFile

func ReadUserConfigFromFile(path string) (*UserConfigJSON, error)

ReadUserConfigFromFile read user confgi from file

Jump to

Keyboard shortcuts

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