requesters

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 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(url string, userCfg *UserConfigJSON, reqCfg *RequestConfigJSON) ([]byte, error)

Send: first gets seed and after that makes target request

func SendWithSeed

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

SendWithSeed sends request with known seed

func SetVerbose

func SetVerbose(verb bool)

SetVerbose switchs 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"`
	Callee   []byte        `json:"callee"`
	Delegate []byte        `json:"delegate"`
}

RequestConfigJSON holds info about request

func ReadRequestConfigFromFile

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

ReadRequesterConfigFromFile read request config from file

type UserConfigJSON

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

UserConfigJSON holds info about user

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