rest

package
v0.0.0-...-0d40728 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseEndpoint string
}

Client represents a basic REST client.

func (*Client) Get

func (c *Client) Get(function string, params map[string]string) ([]byte, error)

Get performs a get using the provided params as query string parameters.

func (*Client) PostFile

func (c *Client) PostFile(function string, fileParameterName string, filename string, params map[string]string) ([]byte, error)

PostFile submits a file in a POST request using a multipart form.

func (*Client) PostJSON

func (c *Client) PostJSON(function string, json []byte) ([]byte, error)

PostJSON posts json data to a URI.

func (*Client) PostRequest

func (c *Client) PostRequest(function string, params map[string]string) ([]byte, error)

PostRequest submits a post request with the provided parameters.

func (*Client) PostRequestRaw

func (c *Client) PostRequestRaw(function string, params map[string]interface{}) ([]byte, error)

PostRequestRaw submits a post request with the provided parameters submitted as a raw string.

type ClientCtor

type ClientCtor func() *Client

ClientCtor repressents a client constructor to instantiate a rest client.

func NewClient

func NewClient(endpoint string) ClientCtor

NewClient instantiates and returns a new REST client constructor.

Jump to

Keyboard shortcuts

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