utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GetLatestMinIOImage

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

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

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

Do implement http.Client.Do()

func (*HTTPClient) Get

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

Get implements http.Client.Get()

func (*HTTPClient) Post

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

Post implements http.Client.Post()

type HTTPClientI

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