request

package
v0.0.0-...-12ab560 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Overview

Package request - contains common methods for JSON over HTTP communications

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpCommunications

type HttpCommunications interface {
	GetJSON(url string) ([]byte, error)
	SendJSON(url string, data interface{}) error
	SendMessage(url string, message *fcrmessages.FCRMessage) (*fcrmessages.FCRMessage, error)
	Delete(url string) error
}

HttpCommunications - facilitates communications between nodes using HTTP

func NewHttpCommunicator

func NewHttpCommunicator() HttpCommunications

type HttpCommunicator

type HttpCommunicator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*HttpCommunicator) Delete

func (c *HttpCommunicator) Delete(url string) error

Delete request to delete a resource

func (*HttpCommunicator) GetJSON

func (c *HttpCommunicator) GetJSON(url string) ([]byte, error)

GetJSON request Get JSON

func (*HttpCommunicator) SendJSON

func (c *HttpCommunicator) SendJSON(url string, data interface{}) error

SendJSON request Send JSON

func (*HttpCommunicator) SendMessage

func (c *HttpCommunicator) SendMessage(url string, message *fcrmessages.FCRMessage) (*fcrmessages.FCRMessage, error)

SendMessage request Send JSON

Jump to

Keyboard shortcuts

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