utils

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: AGPL-3.0 Imports: 8 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCantDetermineMinIOImage = errors.New("can't determine MinIO Image")
)

Functions

func GetLatestMinIOImage added in v0.15.1

func GetLatestMinIOImage(client HTTPClientI) (*string, error)

getLatestMinIOImage returns the latest docker image for MinIO if found on the internet

func PossibleParityValues

func PossibleParityValues(args ...string) ([]string, error)

PossibleParityValues returns possible parities for input args, parties are calculated in uniform manner for one pool or multiple pools, ensuring that parities returned are common and applicable across all pools.

Types

type HTTPClient added in v0.15.1

type HTTPClient struct {
	Client *http.Client
}

HTTPClient Interface implementation

Define the structure of a http client and define the functions that are actually used

func (*HTTPClient) Do added in v0.15.1

func (c *HTTPClient) Do(req *http.Request) (*http.Response, error)

Do implement http.Client.Do()

func (*HTTPClient) Get added in v0.15.1

func (c *HTTPClient) Get(url string) (resp *http.Response, err error)

Get implements http.Client.Get()

func (*HTTPClient) Post added in v0.15.1

func (c *HTTPClient) Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

Post implements http.Client.Post()

type HTTPClientI added in v0.15.1

type HTTPClientI interface {
	Get(url string) (resp *http.Response, err error)
	Post(url, contentType string, body io.Reader) (resp *http.Response, err error)
	Do(req *http.Request) (*http.Response, error)
}

HTTPClientI interface with all functions to be implemented by mock when testing, it should include all HttpClient respective api calls that are used within this project.

Jump to

Keyboard shortcuts

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